Take a look at the milk-demo: http://jquery.bassistance.de/validate/demo/milk/
It's errorPlacement-usage should be a good reference:
// the errorPlacement has to take the table layout into account
errorPlacement: function(error, element) {
if ( element.is(:radio)
OK, after reading the docs a little more closely I came up with the
following which I added to the code above and which AFAIK should work:
var loginValidator = $(#inscriptTalentProfessionnel).validate(
{
errorElement: div,
onsubmit: true,
onfocusout: true,
errorPlacement:
element is a jQuery object, try element[0].name or element.attr(name)
Jörn
On Tue, Jun 24, 2008 at 6:11 AM, pixelyzed [EMAIL PROTECTED] wrote:
OK, after reading the docs a little more closely I came up with the
following which I added to the code above and which AFAIK should work:
var
H Jörn,
I actually posted that before I saw your previous reply which gave me
what I needed to solve that error message placement issue.
I have one more question though. How could I disable the submit button
until the form is all valid?
Thanks very much for your help so far.
The plugin has no direct support for that. You can disable the submit
button in the submitHandler-option (a callback) to prevent a double
submit:
$(...).validate({
submitHandler: function(form) {
$(:submit, form).attr(disabled, true);
form.submit();
}
});
Disabling the button before
I've changed the section title slightly, hopefully this makes it
easier to find them:
http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods
Custom methods are added via $.validator.addMethod:
http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage
I've got another question about this plugin...
On one of my pages I have a form, it has 4 fields a person can input.
I only want to validate two of them, both text boxes. The thing is
that this form can have multiple inputs of the same type. It's for a
CMS I'm building, and it's adding different
Hello Jörn,
Thank you for your help earlier. I'll try to figure out custom methods
later. Right now I'd like to know if it's possible to change the
errorPlacement option for only one specific messgae. I'm trying to
validate multiple checkbox and radiobuton groups and I have the
default
8 matches
Mail list logo