Quantcast
Viewing all articles
Browse latest Browse all 6

Add onClick event on form input with multiple checkbox

To add a javascript onclick event on a form input with multiple checkbox, use this alternative method: $options = array(); foreach($roles as $value => $label) { $options[] = array( 'name' => $label, 'value' => $value, 'onClick' => 'showDiv(this)' ); } echo $form->input('Role', array('options' => $options, ...)); But why use inline javascript? You could do this with […]Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 6

Trending Articles