[jQuery] Re: validation: preprocessing form fields ?

2009-10-18 Thread pike


apparenty not :-)

just for the record - i'm doing things like this:


jQuery.validator.addMethod(
"lowercase", function(value, element) {
jQuery(element).val(value.toLowerCase());
return true;
},""
)


which i can then apply in validation like


var validator = $("#myform").validate({
rules: {
"myfield": "lowercase"
}
})


clearly, thats not really validation, but the issue is it needs to be
executed right before other validation, at the same moments
interfacewise ...

$2c,
*-pike


[jQuery] validation: preprocessing form fields ?

2009-10-07 Thread pike

Hi

I've started using jquery validation on my forms. Often, I need to pre-
process a field before I want to validate it. For example, if someone
forgets to prefix http:// before an url, I can just do that, instead
of returning error messages. Or sometimes, a field needs to be
lowercased and I can just do that, too.

I've found ways to do that, but it feels like a hack. Am I missing a
feature ?

thanks,
*-pike