Skip to content
Advertisement

Javascript document.controller.setValue getValue(this)

How do I get the value of the checkbox (or state, checked or not 1-0) so that I can pass it to a controller?, I’ve tried the following but it doesnt work.

<input class="form-check-input" id="wealth" onclick="document.controller.setValue('/ctx/vars/services',getValue(this));" type="checkbox" value="" />

Uncaught ReferenceError: getValue is not defined at HTMLInputElement.onclick

Advertisement

Answer

change getValue(this) to this.checked. it will get checkbox current state.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement