erikTsomik
asked on
jquery errorPlacement
I am trying to do a jquery validation and place the error message next to the field. Currently it goes after the field. I am using a table structure. So it goes in the same cell as a form element. What I want to do is may be creating a separate cell
errorPlacement: function(error, element) {
if (element.attr('type') === 'radio') {
error.insertAfter(
element.siblings('input[type="radio"][name="' + element.attr('name') + '"]:last'));
}else {
error.insertAfter(element);
}
<td>
<input id="firstname" class="error" type="text" required="" value="" name="firstname" maxlength="50" size="20">
<div class="error" htmlfor="firstname" generated="true">Please enter the First Name.</div>
</td>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
no, but you can give it more width with it's parent, so change the width of its parent container
ASKER
here is my css
Open in new window