How to Receive Form Submissions Using Custom Scripts

One way to receive data submitted through a data capture form is by adding your own script in the Content panel of the block.

Open the Content panel of the block with a form, double click on Form Data Receiver. More options will appear on the screen. Select "Own script for receiving data."

Data is delivered via POST. You can modify the names of variable fields in the Settings panel of the block. Data can also be sent without reloading the page (Ajax).
A sample script for receiving form submissions by email
Add this script to your server and specify the script URL in the Webhook settings. Any responses received via Webhook will be sent to your email.

<?

$headers = "From: from@webhookservesite.ru";
​
 $message = print_r($_POST,true);
 @mail('to@mail.ru', 'Tilda TEST', $message, $headers);

echo"ok";

?>
Data capture services only work when you have an active Tilda subscription. If you plan to export your website, host it on your own server, and cancel your paid subscription, be sure to add your own script for receiving data submitted through data capture forms on your website.
If you add your script using the method described above, the forms will remain active even if your Tilda subscription is expired.
How to add success or failure messages to the script
If you add a custom script to the form and select the "submit data without reloading the page (AJAX)" checkbox, the form will process the following types of responses:
  • {"message":"OK"} - successful data submission;
  • {"message":"Thank you for your submission"} - custom success message;
  • {"error":"This field … contains an error"} - custom failure message.
Alternatively, you can simply send back the submitted response or the HTML.
Note: Unfortunately, the Tilda support team does not assist with questions related to custom codes.
Made on
Tilda