- Computers & Software»
- Computer Science & Programming»
- Programming Languages
Are you looking for a simple client side form field validation for your web page form?
Form validation is needed with all forms that are submitted online. You can have client side or server side validation. Server side is a better solution, because all the work is done on the server side. You have more control and more flexibility on how the validation is done and to what extint. It is more secure than client side.
Blank Form Field Validation
Below is a simple example of a form field validation, when the field is left blank.
HTML Sample Code
Below is a sample of the <HTML> code that can be placed any where inside your web page.
<form name="contact_form" method="post" action="sendform.html" onsubmit="return validate_form ( );"> Email: <input type="text" name="contact_email"> <p> <input type="submit" name="Submit" value="Submit"> </form>