function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
coisty1856coisty1856 

Server Side Form Field Validation

Hello,

Can anyone point me in the right direction on how to implement server-side form validation for my Web to Lead form on my website? I have javascript validation setup for the client side, but obviously this can be bypassed and I want to make sure my forms are validating before the information is entered into Salesforce.

Thanks,

Coisty
Ron HessRon Hess

Apex Code is a future feature, this would allow server side lead validation by writing a trigger on lead insert, until then, there is no server side execution.

you could write code that checks it after it is inserted , using outbound messaging, then operate on the new lead.
SuperfellSuperfell
You should be able to use validation formula's to do this.
coisty1856coisty1856
Any instructions on how to do this? An example somewhere?

Thanks
SuperfellSuperfell
Look in the main salesforce.com application help for validation formula's or validation rules
Park Walker (TAGL)Park Walker (TAGL)
You might want to proceed with caution here. I don't believe that the web-to-lead process will give you any feedback if the validation fails. The lead will just silently disappear. Using the API you have a chance to ask the user to correct the errors and attempt the posting again.

Park
coisty1856coisty1856
That's what I'm after.  I want a message to display saying something like, "Error. Please fill-in the form entirely." I already have this working in client-side javascript, but obviously that can be bypassed and I would like a back-up server-side validation as well.

Surely more people have requested this capability but I can't seem to find any detailed information.
Park Walker (TAGL)Park Walker (TAGL)
As I mentioned, if you want to know if the operation was successful you will probably need to use the API and write some code. There's plenty of information on how to do that in various languages in the Wiki, but, if you're not a programmer, you may need some help.
MavMav
I don't see this information you speak of in the wiki. I can't believe there are not more people who need their forms validated for several reasons. This should have been implemented on the SF side ages ago. *grumble*