You are viewing limited content. For full access, please sign in.

Question

Question

Form Designer Javascript - Clear radio button when the form loads

asked on February 7, 2024

I can't figure out how to clear a radio button field (all options unchecked) when the form loads using "Javascript" in the new form designer. There doesn't even seem to be an event like $(document).ready. Has anyone done this before?

Thanks in advance!

0 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on February 7, 2024

Whoops sorry I just saw the part about the new designer.

This should work:

LFForm.setFieldValues({fieldId: 1}, {value: ""}); 

 

3 0

Replies

replied on February 7, 2024

Try this:

$(document).ready(function(){
    $('.myField input').prop('checked', false).change();
  });

 

0 0
APPROVED ANSWER SELECTED ANSWER
replied on February 7, 2024

Whoops sorry I just saw the part about the new designer.

This should work:

LFForm.setFieldValues({fieldId: 1}, {value: ""}); 

 

3 0
replied on February 7, 2024

Thank you so much! I don't fully understand events with javascript in the new designer yet, and this helped a lot.

1 0
replied on March 8, 2024

Just wanted to say THANK YOU! I have been trying to find a way and this finally worked!

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.