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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -