Controlling client validation message position

Jun 17, 2009 at 9:13 AM


Presently xVal renders error messages from client validation right after the validated input controls (injected into DOM?).

This might sometime not be desired, as it might break the page layout.

Is it possible to have some control over where the client side validation error message is displayed?
Preferably in the same place where server side validation message is displayed (<%= Html.ValidationMessage("...")%>). I guess there would need to be some empty span with a known id present in the page (eg rendered by the Html.ValidationMessage) even if there would be no message to show at the time when page is rendered.

thank you,

Jun 17, 2009 at 11:04 AM


You can control all of this by either:

1.) Editing the xval.jquery.js file and ammending the options being used.

2.) Alter the jquery validate options on page load.

There have been a couple of discussions on this already I believe.

Thanks, Mark