PHP Classes

How do add function ?

Recommend this page to a friend!

      PHP JSON Form Builder  >  All threads  >  How do add function ?  >  (Un) Subscribe thread alerts  
Subject:How do add function ?
Summary:How do add function ?
Messages:3
Author:BratSadLove
Date:2020-05-15 12:36:51
 

  1. How do add function ?   Reply   Report abuse  
Picture of BratSadLove BratSadLove - 2020-05-15 12:36:51
Hi guy !

I have a question for you. If you want add function javascript in form , how to do it's ?

  2. Re: How do add function ?   Reply   Report abuse  
Picture of Arash Soleimani Arash Soleimani - 2020-05-15 15:38:07 - In reply to message 1 from BratSadLove
Hi, Thanks for using my class. You can add onClick or onChange to your field JSON object.

Button example:
"myButton": {
"type": "button",
"title": "My Button",
"name":"mybutton",
"onClick":"alert(1);console.log('something')"
}

or

Input example:
"firstName": {
"type": "input",
"title": "First name",
"name":"firstName",
"value": "test",
"onChange":"YourJavascriptFunction(this.value)"
}

<script>
const YourJavascriptFunction = (data) =>{
// do something
}
</script>

If you have any questions, let me know.

  3. Re: How do add function ?   Reply   Report abuse  
Picture of BratSadLove BratSadLove - 2020-05-18 11:41:51 - In reply to message 1 from BratSadLove
Thanks so much !