Currently: successfully executing input validation. The input borders are highlighted red, which is exactly what I need.
The solution was found here, but I also need to add a tooltip to any of the fields that are left blank.
I'd also like to fill each tooltip with a message explaining the user error.
function validationHelper() {
var isValid = true;
$('#textBox1,#textBox2,#textBox3,#textBox4').each(function () {
if ($.trim($(this).val()) == '') {
isValid = false;
$(this).css({
"border": "1px solid red",
"background": "#FFCECE"
//do I add tooltip property here?
});
}
else {
$(this).css({
"border": "",
"background": ""
});
}
});
if (isValid == false) {
return false;
}
return true;
}
I'd appreciate any suggestions. Thanks in advance.
css()as in your example.