You need to sign in to do that
Don't have an account?
Vandana Rattan 4
Validate HTML Input elements
I have a Visualforce page containing HTML elements like:
How can I validate these fields before submitting the form? The validations have to be for
Mandatory fields
Email format
Thanks in Advance
<label for="firstName">First Name<span style="color: red;">*</span></label></b> <br></br> <input type="text" name="fName" id="fName"> </input> <br></br> <b><label for="lastName">Last Name<span style="color: red;">*</span></label></b> <br></br> <input type="text" name="lName" for="lName" id="lName" > </input>
How can I validate these fields before submitting the form? The validations have to be for
Mandatory fields
Email format
Thanks in Advance
Below is the HTML code for the required input validation, you have to set required = True You can set the Type="email" to set the input field to support values in email formate. Make sure that you have set docType="Html-5.0" in the apex:page attribute
All Answers
Below is the HTML code for the required input validation, you have to set required = True You can set the Type="email" to set the input field to support values in email formate. Make sure that you have set docType="Html-5.0" in the apex:page attribute
For me strangely this was not working. I had checked this in first place. I had to write custome javascript code for validations.
Regards,
Vandana