Summer Sale: Save 20% on any WS Form edition CODE: SUMMER20 View Pricing

Run JavaScript When Forms Are Saved or Submitted in WordPress

Run custom JavaScript when a form is saved, submitted, or both.

  • Run on save Trigger JavaScript when a form is saved.
  • Run on submit Trigger JavaScript when a form is submitted.
  • Run on both Choose to run the action on save and submit.
  • Custom JavaScript Enter your own JavaScript in the editor.
  • Use WS Form variables Include WS Form variables in your JavaScript.
  • Action sidebar setup Add and configure the action from the form Actions sidebar.

Use the Run JavaScript action to run JavaScript when a form is saved or submitted. This gives you a direct way to add custom behavior to your forms in WordPress.

You can choose when the action runs: on save, on submit, or both. Enter your JavaScript in the action editor and save your changes in the sidebar.

The JavaScript can include straight text or WS Form variables. For example, you can output submitted values inside your script.

  • Flexible trigger timing

    Choose whether your JavaScript runs when the form is saved, submitted, or both.

  • Built into Actions

    Add JavaScript from the Actions area while editing your form.

  • Editor-based input

    Enter the JavaScript you want to run directly in the action settings.

  • Variable support

    Use WS Form variables inside your JavaScript when needed.

  • Plain text supported

    The JavaScript field can include straight text as part of your script.

  • Works on form events

    Attach custom JavaScript to key form events without leaving the form builder.

  • Simple to add

    Create a new action, select JavaScript, and configure the settings that appear.

  • Save or cancel changes

    Like other WS Form sidebars, you can save your changes or cancel them.

Real Customer Reviews

Trusted by thousands of WordPress professionals.

  • By far the best plugin of the WordPress ecosystem … amazing tool, superb support and the best documentation ever produced by a developer … you have no idea.

    bangelo123
  • Mark and his team are tremendous! Always going above and beyond. Great product and even greater support.

    pt2330
  • Everything you could want, it has. So powerful. Usability is off the charts. And to top it off, the support is best in class.

    Keith Manning

Frequently Asked Questions

What does the Run JavaScript action do?

It allows you to run JavaScript when a form is saved or submitted.

When can the Run JavaScript action run?

You can choose to run it when the form is saved, submitted, or both.

Can I use WS Form variables in the JavaScript?

Yes. You can enter straight text or use a WS Form variable in the JavaScript.

Where do I enter the JavaScript?

Enter the JavaScript you would like to run in the editor in the action settings.

How do I run JavaScript on save or submit in WS Form?

When editing your form, click the Actions icon at the top of the page, add a new action, select JavaScript from the Action pulldown, configure the settings, and save your changes. You can also learn more here: Run JavaScript.