1. Home
  2. Docs
  3. FAQ
  4. How do I stop the submission through scripting

How do I stop the submission through scripting

With Kali Forms you can stop the form submission process easily if the information entered by the user does not meet a certain condition. This is done through the Custom PHP > Before form process PHP script section.

This scripting area is only available for Kali Forms Pro users.

The information submitted in your form can be accessed with the help of the $form_data array, using the field name as the key, the syntax is:


A very simple example is to add a normal dropdown field to your form, named submitForm, with two options: yes and no. We will only allow the form to be submitted if the user selects the value yes in this field.

After configuring the dropdown field with the two options, navigate to the Custom PHP section and add the following code snippet in the Before form process PHP script section:

if($form_data['submitForm'] == 'no') {
$form_data['admin_stop_execution'] = true;

Simply stopping the form submission without explaining to the user why his submission cannot be made is not a good practice, in order to avoid this you can use the Global error message available in the general form configuration. This message will be displayed when the submission process is stopped through the above condition.

How can we help?