[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-26 Thread Simon Whatley
Hi Jörn Firstly, the form I have to work with is not of my creation and is somewhat flawed! I agree, your first example would be invalid if the forms were on the same page. If they were on separate pages the IDs are not invalid. However my example is a form that collects a number of instances

[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-26 Thread Jörn Zaefferer
Previous version of the plugin used IDs solely, and there are way to many drawbacks to give that another try. But I think that isn't even necessary, there are other solutions. To start with, you can add classes to inputs to define their validation rules. If you have no control over the

[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-25 Thread Jörn Zaefferer
Repeating the same IDs across forms won't work, IDs have to be unique. That is why the plugin relies on names, as those have to be unique (from the plugin point of view) only within their form. You can try to hack the plugin, replacing all element.name snippets with element.id, but I won't

[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-25 Thread Simon Whatley
Hi Jörn, Element IDs are unique to a page, whereas names are not. By this very fact, it is problematic applying validation rules to a specific element if that element's name exists multiple times (as will often be the case, especially with checkboxes, radio buttons and mutliple- selects). The

[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-25 Thread Simon Whatley
Hi Jörn, IDs are unique to the page rather than across forms, names do not have to be. The forms I refer to are not on the same page, but on a new instance of the page when a user clicks the submit button. The rule should/could therefore apply to the ID and not the name, since the name can be

[jQuery] Re: [validate] Validation Rules based on IDs rather than Names

2008-06-25 Thread Jörn Zaefferer
Let just get this straight, I consider this invalid and useless html: form input id=e1 name=e1_1 / input id=e2 name=e1_2 / /form form input id=e1 name=e2_1 / input id=e2 name=e2_2 / /form While this is valid and useful, and works fine with the validation plugin: form input id=e1_1 name=e1 /