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 -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -