Currently, I am utilizing the JQuery validation plugin to validate a form. However, in addition to displaying an error message, I also want it to modify the CSS for the td element above it. This is my current implementation:
function handleValidationErrors(element) {
element.closest("td").addClass("customValidationErrorClass");
}
$("#form691575").validate({
errorPlacement: handleValidationErrors,
rules: {
field7014601: {
required: true
}
});
The form ID is form691575 and field7014601 pertains to a name field. Although I cobbled together the handleValidationErrors function based on another suggestion I came across, I would appreciate a more streamlined approach that achieves the same outcome.
Thank you.