I attempted to implement a validation using regular jQuery and managed to accomplish half of it successfully. When I try to submit an empty field, the textbox border turns red, but if I fill in the value and click the button again, the border doesn't change color. Below is my jQuery code:
if ($.trim($("input[id$='prgIDText']").val()).length < 1) {
errMsg += "Program ID cannot be blank <br/>";
$("input[id$='prgIDText']").css("border", "2px solid red");
}
else {
alert($.trim($("input[id$='prgIDText']").val()).length);
$("input[id$='prgIDText']").css("border", "border:1px solid #CCC");
}