When clicked checkbox assign values to input field.
-
Hello,
I have checkbox (fieldname234) and when user tick it i want to assign values to my input fields.
I set up default value of checkbox FALSE in plugin and added this html script to change it TRUE if clicked. This is working.
<script> jQuery(document).on( 'change', '[id*="fieldname'+'234_"]', function(){ jQuery(this).val(this.checked ? "TRUE" : "FALSE"); }); </script>
Then if this value TRUE assign some values to my input fields doesn’t working. (code is below).
<script> jQuery(document).on( 'click', '[id*="fieldname'+'234_"]', function(){ var value = jQuery(this).val(); if (value == 'TRUE') { jQuery('[id*="fieldname'+'84_"]').val(jQuery('[id*="fieldname'+'13_"]')).change(); } else { jQuery('[id*="fieldname'+'84_"]').val('').change(); } }); </script>
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘When clicked checkbox assign values to input field.’ is closed to new replies.