Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
    
Monica, can you please paste the code you have for getting the field control? –  Arsalan Adam Khatri Oct 23 '12 at 10:25
add comment

1 Answer 1

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);
share|improve this answer
    
Monica, if you found this answer helpful it would be great it you marked it as correct. This way you improve your accept rate and other users with the same problem can find the answer more easily. –  Rafał Saltarski Oct 24 '12 at 10:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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