Question:

Why can simple html form not validate user input at what point can the data be validate

by  |  earlier

0 LIKES UnLike

Why can simple html form not validate user input at what point can the data be validate

 Tags:

   Report

2 ANSWERS


  1. Because HTML doesn't have any builtin methods for form validation, it was never designed to do that.

    Form validation can take place on the client, using JavaScript, our once the form has been processed on the server, using a scripting language such as PHP or ASP.


  2. There are two main ways that form data can be validated.

    - Javascript

    - Server side

    With Javascript you want to make a function that will run before the form is actually sent to the action.  After which point the function can determine if it should let it go through (return true) or it should fail (return false).

    With server side you are using a language (like PHP, ASP, ect) that can check the values of the form and then if there are problems send it back to the page it was just on to correct.  This is much more secure and fail-proof then the javascript version.  Since the Javascript version people can see what you are looking for and find a way around it.  However, if you do send them back to the form they were just on it would be wise to put the values they already typed back in the boxes.  That way you don't have unhappy customers.

    Take care,

    Chad

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.