php - Validate inputs with jQuery -


objective:

validate input form. if okay, submit it, otherwise return error user.

problem:

i want validate inputs in form, don't know how cleanly.

how can validate form safely without heavy validation libraries?

try this:

    function validate() {         if (validatefield(document.form.field1) &&              validatefield(document.form.field2) &&              validatefield(document.form.field3) &&              validatefield(document.form.field4) &&              validatefield(document.form.field5))            return true;         else            return false;     }   function validatefield(field) {   //your condition of validation } 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -