I want to set the value of yes/no field.Through JavaScript I got the field control but unable to set value.
2 Answers
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);
You can set checked
the property using jQuery.
$('input[name=SimpleHTMLCheckbox]').prop('checked', true);