I am using jquery validation plugin and zend framework. I have my form in a table. I am displaying an image as an error when a textfield is not validated. The error image is displayed very next to textbox in the same td of table. But I want to show error message/image in next td of same tr.
For example this is before submit:
<table><tr><td>First Name</td><td><input type="text" class="required" /></td><td></td></tr></table>
I want this after submit with empty field:
<table><tr><td>First Name</td><td><input type="text" class="required" /></td><td><img id='exclamation' src='images/exclamation.gif' title='This field is required.' /></td></tr></table>
I am using this js function for now:
$(obj).find("input.required").each(function(){
$(this).rules("add", {
required: true,
minlength: 2,
messages: {
required : "<img id='exclamation' src='images/exclamation.gif' title='This field is required.' />",
minlength: "<img id='exclamation' src='images/exclamation.gif' title='At least 2 characters.' />"
}
});
});