Formyoula Guides đź“–
Formyoula Guides đź“–

Trigger JavaScript Using The Field Update Button

This guide will explain how to trigger JavaScript on your form by clicking the Field Update Button.

  1. Initial Setup:
  • Drag and drop a “Field Update Button” along with the “JavaScript” field onto your form.
  • Rename the fields as needed.
image
  1. Configuring The “JavaScript” Field:
  • Click the pencil icon of the “JavaScript” field.
  • Paste the code.
  • Here 090c-b994-2f4f is the field Id of the “JavaScript” field to trigger.
image
  • Please use this code:
// Listen to JS field event trigger
formyoula.form_fields[ '090c-b994-2f4f' ].on( 'run', function() {
// Run logic
alert( 'Triggered by workflow' );
} );
  1. Configuring The “Field Update Button” Field:
  • Click the pencil icon of the “Field Update Button” field.
  • Set “Field Updates” - JavaScript || event || run
  • Save the changes.
image
  1. Test The Form:
  • Click the Field Update Button.
image
  • It will display a message and will trigger the JavaScript.
image

For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂