How can ignore some text box ignore for validation checking. Below code is applied for all text but I need to leave few text box blank, but due to the code I am not able to submit the form with optional text box. Kindly refer the jquery code which is used for validating ALL text box
<script>
$(document).ready(function() {
$('#btnSubmit').click(function(e) {
var isValid = true;
$('input[type="text"]').each(function() {
if ($.trim($(this).val()) == '') {
isValid = false;
$(this).css({
"border": "1px solid red",
"background": "#FFCECE"
});
}
else {
$(this).css({
"border": "",
"background": ""
});
}
});
if (isValid == false)
e.preventDefault();
else
alert('Thank you for submitting');
});
});
</script>