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
JMcLeodFEWAJMcLeodFEWA 

Requiring Fields on Server or Client Side on Web2LeadForms

Has anyone successfully figured out how to require and notify the user completing the web 2 lead form that they haven't field out required fields? Or has anyone written a code that will first check to see if the fields are filled out and then once the data is validated then send (post) the data to the salesforce servlet?
I found a sample form i can use to make my web 2 lead forms required and have the message post back to form saying the required info hasn't been submitted, but does anyone know how to then make it post to SF?
 
I guess what im looking for is someone that has done this, and then wouldn't mind sharing the code with me so i can get it up and running for my org(a template of code i could modify for my org) . Any information would be greatly appreciated.
 
Thanks,
JMcLeod @ FEWA
Ron HessRon Hess
lots of forms on the web have this feature, requiredness, they usualy put a color around the field or other indicator.

then in the onsubmit callback for the form, the javascript checks that the required fields are filled in and halt the submit ( return false) if info is missing, notifying the user in the process.

here is a sample to try

http://javascript.internet.com/forms/required-fields.html


JMcLeodFEWAJMcLeodFEWA
Thanks so much, that looks like that will work since it halts the send. I will try to make it work for me. Looks like exactly what i was looking for!
JMcLeodFEWAJMcLeodFEWA
Just to let you know, I was able to do what I wanted with the examples you gave. Thanks a million.