I am using the jQuery validation plugin and when I add the class required to the textboxes it validates the fields. However, the error message is shown after the text box an
Use errorPlacement. Example:
$("#field-GeoLatlon").validate({
rules: {
"parameters[postcode]": {
isPostcode: true
},
"parameters[houseno]": {
startsWithNumber: true
}
},
errorPlacement: errorPlacement
});
function errorPlacement(error, element)
{
var errorDD = $('<dd class="error"></dd>').insertAfter(element.parent('dd').next('dd'));
error.appendTo(errorDD);
}