Is there a way to set value of text box when a check box is selected?
I am trying to enter the value 1 into a single line text box when a checkbox is selected and then save the form.
Solved! Go to Solution.
Open the settings for the Checkbox and expand the Formatting section. For the control CSS class, set it to cssCheckbox.
// find the Checkbox control and the Textbox control
var myCheckbox = NWF$('.cssCheckbox').find("input[type='checkbox']");
var myTextbox = NWF$('.cssTextbox');
// add an event handler, when the checkbox is checked or unchecked
Hope this helps.
Thanks for this but it did not work.
I am trying to populate the value of a text box to interger (1, 2 etc) when checkbox is ticked on runtime.
My Scenario: User check the checkbox and as soon as it is checked....Textbox shows value 1 and then we can save the form and it saves value 1 to text box.
Hope I am making sense
My requirement is the same, however I prefer to have some fields not shown on the form...... Which can be accomplished by using a Hide formatting rule with a condition that is always is true.