mrblah
mrblah

Reputation: 103517

Using the jQuery Validation plugin, how can I display the validation errors in my own span tag?

Currently the jQuery Validation plugin is displaying an error by creating its own label tag, using the class error.

Is it possible for me to place a tag on the screen, and if there is an error have the error message injected into that tag?

Upvotes: 0

Views: 152

Answers (1)

redsquare
redsquare

Reputation: 78667

You can specify a container and a wrapper element e.g

$("#myform").validate({
   errorLabelContainer: "#messageBox",
   wrapper: "span",
   submitHandler: function() { alert("Submitted!") }
})

see the options in the help

Upvotes: 2

Related Questions