jQuery validation plugin - no error messages instead custom backgrounds

Posted by Skoota on Stack Overflow See other posts from Stack Overflow or by Skoota
Published on 2011-01-02T09:47:03Z Indexed on 2011/01/02 9:53 UTC
Read the original article Hit count: 193

Filed under:
|

I am using the jQuery validation plugin. The form which is being validated has custom background images for the text input fields, so instead of showing an error message for invalid fields I would like to change the background image. Making things a bit trickier is that the background image for the fields is on a different div absolutely positioned behind the text field (which has a transparent background and no border). I will spare going into the reasons for this design decision here (it's related to margins within the text field) but I thought it should be mentioned since it is critical to this question.

Therefore, I have two questions:

  1. How can I stop the display of the error messages all-together?

  2. How can I instead tell the validation plugin if, for example, the name field (e.g. <input id=name ... />) is invalid then it should change the background for the relevant div (e.g. <div id=name-bg... ></div>)?

Thanks for any assistance!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-validate