Hi I am trying to select only the fields who's CSS property is not Display: "None". Please have a look at the code and please let me know what an I doing wrong?
function (controlId) { var returnValidFlag = true;
//var requiredClass = $this.find('.required');
//console.log(requiredClass);
$('.required:not([display=none])').each(function () {
// Get 'this' HTML object's ID
var thisInputID = $(this).attr('id');
// Get 'this' error message
var thisErrorMessageID = thisInputID + 'ErrorMessage';
// console.log('Error ID: ' + thisErrorMessageID);
// Get the user input value
var thisInputValue = $(this).val();
console.log('Input ID: ' + thisInputValue + " " + thisErrorMessageID);
if (thisInputValue =='') {
returnValidFlag = false;
$('#' + thisErrorMessageID).show();
} else {
returnValidFlag = true;
$('#' + thisErrorMessageID).hide();
}
});
return returnValidFlag;
}