views:

81

answers:

1

Hi all,

Using jQuery validation plugin, how can I configure it so that I have the error labels appear beside the input fields, and also inside a validation summary?

I can make them either display besides the input fields OR inside a validation summary, but not in both. I'd like to have the error messages duplicated (one for the input field and another for the validation summary).

Is it possible? If yes, how?

Thanks

A: 

You can control error placement using the following options

errorElement 
errorLabelContainer 
errorContainer 
showErrors

View Docs Here http://docs.jquery.com/Plugins/Validation/validate#toptions

These docs have demos and example code.. Its very helpful.

John Hartsock
Thanks I looked at those properties and example page, but there isn't any example that places the error messages after the input fields AND inside a validation summary panel. I think the library doesn't support this kind of functionality?
LD2008
LD2008...you have to use your imagination. look at my example
John Hartsock
Here is a link to display the error in the title attribute of the input, Clearly it is different than what you want but use your imagination and instead of appending an attribute add a span element with the text. http://stackoverflow.com/questions/2375584/how-to-not-display-error-element-as-label-with-jquery-validation-plugin
John Hartsock
As for the other part of your question showErrors option should assist you. But really before using a framework, read the documentation. I will say the documentation is not well formated but is very useful if you read it and make simple examples using the features. Sorry about the vauge comments, but Its friday night and im drinking a beer. didnt really want to code much.. was just checking out some stuff.
John Hartsock