Jquery Validation when all enabled fileds are not empty -


please me following using jquery.

condition 1: how can check if fields(input, textarea, select) enabled not empty or has selected value.

condition 2: fields disabled not included in validation on condition 1.

ive tried lot of codes , code below seems do, captures fields including disabled.

$('#btnsave').click(function (e) {     $('input:enabled:not([readonly])').each(function () {         if ($(this).val() == "")         {             alert("please fill out fields.");             e.preventdefault();             return false;         }         else         {             addsomestuffs();         }     });  }); 

can me on this.

thanks in advance.

use jquery form validation in achieving requirement

https://jqueryvalidation.org/

hope helps


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -