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

Question

Question

Set Checkbox/Radio Default Value

asked on April 25, 2014

 I'm looking for a way to set a checkbox/radio button to a default value.  I have limited knowledge of Javascript so I'm hoping I can do this without code.  

 

Thanks,

 

Nate

CheckBox Screenshot.PNG
0 0

Answer

SELECTED ANSWER
replied on April 25, 2014

You can set the default value without using javascript, you can do it by clicking the number before the option.

5 0
replied on April 25, 2014

Awesome, thank you Lena!

0 0

Replies

replied on April 25, 2014

I recommend using Firefox when developing javascript. I find it easy to preview a form, right click and inspect element. then you can use the dropdown on the selected element to copy it's unique identifier. This will be what you need to use to do the following:

$('[FieldID]').attr('checked', true);

Your [FieldID] should likely contain a hyphen with a number at the end. In the case of your checkbox image, I would expect the "Checkbox 1" field to have a value of '#[FieldNumber of checkbox field]-0'

1 0
replied on April 25, 2014

Kenneth,

 

I tried the code you gave me and I think my mistake is in the fieldID area.  I've attached a couple of screenshots to show you what I have.  Let me know what I'm doing wrong.  

 

Thanks,

 

Nate

CheckBox Screenshot.PNG
CheckBox Screenshot - 1.PNG
1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.