HOW TO add javascript event handler to the specific field?

Discuss everything related to FormBuilder. All versions. Any questions related to the FormBuilder developing or using should be posted to this forum.

Moderators: alexandrleonenko, goas

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO add javascript event handler to the specific field?

Postby administrator » Dec 25th, '14, 18:52

To add your own Javascriopt event handler to any separate field following method:

Code: Select all

->AddJavascriptOnEvent(array('onclick'=> 'alert(\'Hello\')'))


See the full example of code:

Code: Select all

//BUTTON
$form->AddButton('button', 'Say \'Hello\'')
   ->AddJavascriptOnEvent(array('onclick'=> 'alert(\'Hello\')'))
   ->SetFieldSet('Button');

Return to “ApPHP FormBuilder {developers/users}”