Forums

Server Side Validation

insightcreative 20 Aug, 2010
Hi

We're using Chronoforms on a site and a few of the forms post info to SalesForce.com. We use the submit URL to do this on the General Tab of the form setup.

All ok so far with the submitted info being passed to SalesForce successfully.

However, this seems to disable any form validation which makes sense but means that users can post a blank form.

So, I've enabled server side validation and put this into the code box:

<?php
if ( $_POST['first_name'] = 'Andy') {
   return 'Please enter your first name';
}
?>


I go to the form, enter Andy in the first_name field which should trigger the message but it allows the form to be submitted anyway.

I don't want to use the OnBlur Validation method unless I have to. Am I using the server side validation correctly or is there another way to validate the form before it goes off to SalesForce?

Best regards

Andy
GreyHead 20 Aug, 2010
Hi insightcreative,

If you use the OnSubmit URL the form data is returned to that URL; ChronoForms never sees it and therefore can't do *anything* with it (server-side validation, emails, security checks, database saves, redirects, etc.).

If you want ChronoForms to do any of these things then don't use the OnSubmit URL. YOu can usually achieve the same results with either the ReDirect or the cURL plugin.

Bob
This topic is locked and no more replies can be posted.