1

I want to set the value of yes/no field.Through JavaScript I got the field control but unable to set value.

1
  • Monica, can you please paste the code you have for getting the field control? Commented Oct 23, 2012 at 10:25

2 Answers 2

2

Yes/No control is a html checkbox so if you want to check it you need to set CHECKED attribute of the control to some value CHECKED = "checked" if you want to uncheck it you need to remove this attribute. To set value of the control you need to set "value" attribute to your value.

Easily done using jQuery:

$('input[name=SimpleHTMLCheckbox]').attr('checked', true);
0
0

You can set checked the property using jQuery.

$('input[name=SimpleHTMLCheckbox]').prop('checked', true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.