[jQuery] Re: Resetting validation rules dynamically

2008-06-20 Thread kapowaz
I see one thing I've done wrong above; the arguments to the method provided to addMethod() should be (value, element) rather than just (element). Unfortunately having changed this, it's still not working; rather than getting a silent failure, the validation check is still being applied to the

[jQuery] Re: Resetting validation rules dynamically

2008-06-19 Thread kapowaz
Zaefferer [EMAIL PROTECTED] wrote: You need to make sure that your custom method checks for optional elements. Check those additional methods for examples:http://dev.jquery.com/view/trunk/plugins/validate/additional-methods.js Jörn On Wed, Jun 18, 2008 at 2:20 PM, kapowaz [EMAIL PROTECTED

[jQuery] Re: Resetting validation rules dynamically

2008-06-18 Thread kapowaz
Alright, I've found the bug with the above code (the callback function itself doesn't return true or false; only the anonymous method inside it does), and corrected it. However I've since stumbled upon another problem; if any field uses a callback method to determine required status, but *also*

[jQuery] Re: [validate] Resetting validation rules dynamically

2008-06-17 Thread kapowaz
Okay, I've refactored my code extensively to use this method instead (which does make more sense, now that I realise what it's for!)... unfortunately it still doesn't appear to work. For the purposes of demonstrating how I'm using it, I've created this test case:

[jQuery] [validate] Resetting validation rules dynamically

2008-06-16 Thread kapowaz
I'm currently using the jQuery Validation plugin on a page that needs to dynamically update the particular rules you validate against according to which options the user selects (imagine a payment page which accepts different payment methods; you wouldn't want to validate against credit card

[jQuery] Re: [validate] Specifying custom highlight/unhighlight methods

2008-06-09 Thread kapowaz
On Jun 6, 4:32 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: The latest release has a bug where unhighlight is called whenever validating an element, instead of only when the valid-state changed. This is fixed in the latest revision, please give that a

[jQuery] Re: [validate] Validating against a combination of fields

2008-06-06 Thread kapowaz
On Jun 5, 5:29 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: I've added a short explanation and an example here:http://docs.jquery.com/Plugins/Validation#Validating_multiple_fields_... Excellent, thanks! I'll give that a go.

[jQuery] [validate] Specifying custom highlight/unhighlight methods

2008-06-06 Thread kapowaz
I'm trying to specify a couple of custom methods for highlighting/ unhighlighting valid/invalid fields on my form, but I'm getting some strange behaviour, which I'm not sure is due to me misunderstanding how these methods are supposed to be implemented, or if it's just buggy. My custom methods

[jQuery] [validate] Validating against a combination of fields

2008-06-05 Thread kapowaz
I'm trying to create a custom validation rule which works based on a pair of form fields (specifically, two select elements representing month and year, which must be a date in the future). I couldn't see any examples of this pattern in use, and wanted to ask if it was even possible? How might

[jQuery] Re: Determining form state without displaying error messages

2008-03-03 Thread kapowaz
Right, after further investigation I believe that the problem is deeper than simply a bug with validate (I don't think there is one; it's just not designed to do what I'm attempting). So I figured I'd write up some more of my thoughts about what I'd like to do. Essentially, for a given form, I

[jQuery] [validate] Error messages displayed a second time are given block display mode

2008-02-18 Thread kapowaz
I've created a new ticket (http://dev.jquery.com/ticket/2359) with a patch for a quirky bug I've discovered, which may or may not be a bug in the .show() method of jQuery itself, or perhaps just a bug within the validation plugin. The problem is manifest when error messages are configured to be

[jQuery] [validate] Determining form state without displaying error messages

2008-02-15 Thread kapowaz
I'm trying to write a custom view for a form which allows the condition of the form to be represented independently of error messages, by updating the class on another element accordingly whenever the form is changed. So, I have the following code: $('#myform').change(function() { switch

[jQuery] Re: [validate] Adding custom behaviours following validation

2008-02-12 Thread kapowaz
Excellent! That works nicely. The method names might benefit from being a bit more obvious (and documented on docs.jquery.com?) though. Pass and Fail come to mind.

[jQuery] [validate] Adding custom behaviours following validation

2008-02-11 Thread kapowaz
I'm looking to modify the markup surrounding my form elements once validation has taken place so as to indicate success/failure with a particular input element's contents, and I'm wondering if the Validate plugin can do this without any modification? To give an example, imagine I have the