Back button for errors

This applies to the free version and the Pro version.

If the script detects any errors in the submitted form it shows the error(s) on the screen. To provide a convenient way for the user to return to your form, you can make a "Back" button show below the error(s). This does the same thing as hitting "Back" in the browser.

To make a Back button you will need to edit the script code. Open the script in a text editor. locate this line in the script:

if(count($errors)){foreach($errors as $value){print "$value<br>";} exit;}

Replace it with this line:

if(count($errors)){foreach($errors as $value){print "$value<br>";} print "<p><form><input type=\"button\" value=\"Back\" onclick=\"history.go(-1)\"></form>"; exit;}

In the above line, value=\"Back\" is the wording that appears on the button, you can change this to suit. The backslashes are there to escape the quotes for PHP and should be retained.

The above code needs Javascript to work (most people have this by default). Alternatively, you could simply provide a link to the form (but calling it up fresh would probably wipe out the information that was on it) like so:

if(count($errors)){foreach($errors as $value){print "$value<br>";} print "<p><a href=\"contact_page.html\">Click here to return to the form</a>"; exit;}

In the above line, "contact_page.html" is the name of the page containing the form.

When you have made the changes to the script, save it and upload it to your webspace.