How to check form data when javascript is disabled?

I set the validation of the entered data. this check is done using javascript. however, when I turned off the javascript of my browser that the check did not work.

+4
source share
3 answers

Server-side validation is always the best option. However, if server-side validation is missing, you can use HTML5 validation.

HTML5 also offers verification of the web addresses entered in the fields and the numbers in the fields. Validation of numbers even takes into account the minimum and maximum values ​​of attributes, so browsers will not allow you to submit a form if you enter a number that is too large.

If you do not want to validate the form using HTMl5, just use the novalidate attribute

 <form novalidate> <input type="email" id="addr"> <input type="submit" value="Subscribe"> </form> 
+1
source

You should always check the data on the server side (there is PHP), even if javascript is enabled.

With HTML5, you can add the required attribute:

 <input type="text" required="true" /> 
+1
source

You can verify this via PHP or PERL after submitting the form (from the servers). You have to do this every time, in addition to checking javascript

Check out http://buildinternet.com/2008/12/how-to-validate-a-form-complete-with-error-messages-using-php-part-1/

+1
source

All Articles