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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -