[jQuery] Re: Dynamic form validation on different names possible?

2009-01-05 Thread dfiguero
Thanks for your help Jörn. I finally figured out what my problem was. The page doesn't load all the input elements in the form until the user manually selects a year. In other words the rules get empty values because there are no matching rules at the point where $ (function()...) is call. Now I

[jQuery] Re: Dynamic form validation on different names possible?

2009-01-05 Thread dfiguero
Jörn thanks for all your help, I read some more of your comments on the plugin page and I finally solved my problem with the code below (just in case anyone runs into the same issue): $.validator.addMethod(start, function(value, element, param){ Date.format = 'mmm. dd, ';

[jQuery] Re: Dynamic form validation on different names possible?

2008-12-23 Thread dfiguero
It seems as if the rules object is never being passed to validate(). From what I can see there are no rules when normalizeRules is being called however the elements are being called correctly. Would I need to call the compare function in a different form? I can't see much difference on the way I

[jQuery] Re: Dynamic form validation on different names possible?

2008-12-23 Thread Jörn Zaefferer
Replace this: $(.tableform).validate({debug: true, options: rules}); with this: $(.tableform).validate({debug: true, rules: rules}); Jörn On Fri, Dec 19, 2008 at 4:00 PM, dfiguero dfigu...@gmail.com wrote: So far I got: $(function(){ $.validator.addMethod(compare, function(value, element,

[jQuery] Re: Dynamic form validation on different names possible?

2008-12-19 Thread dfiguero
So far I got: $(function(){ $.validator.addMethod(compare, function(value, element, param){ Date.format = 'mmm. dd, '; sdate = Date.fromString($(param[0]).val()); edate = Date.fromString($(param[1]).val()); return (sdate.getTime() = edate.getTime()) ||

[jQuery] Re: Dynamic form validation on different names possible?

2008-12-18 Thread Jörn Zaefferer
You could generate the rules object. var rules = {}; $(:input[name*=date-start]).each(function() { rules[this.name] = { ... } }); $(...).validate({options:rules}); Jörn On Thu, Dec 18, 2008 at 3:01 PM, dfiguero dfigu...@gmail.com wrote: Hi, I'm trying to validate a form with a dynamic

[jQuery] Re: Dynamic form validation on different names possible?

2008-12-18 Thread dfiguero
Thanks Jörn I'll give it a try! On Dec 18, 12:17 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: You could generate the rules object. var rules = {}; $(:input[name*=date-start]).each(function() {   rules[this.name] = { ... }}); $(...).validate({options:rules}); Jörn On Thu,

[jQuery] Re: Dynamic Form Validation?

2007-08-24 Thread Mario Moura
SeViR Thanks I will try ASAP. I dont know if this make sense, I am just thinking. but the plugin core shouldnt indicate type=submit or should avoid it because in this situation could bring problems with ajax and others submit buttons into the main form. I am not sure about this. But anyway

[jQuery] Re: Dynamic Form Validation?

2007-08-24 Thread Jörn Zaefferer
Mario Moura schrieb: SeViR Thanks I will try ASAP. I dont know if this make sense, I am just thinking. but the plugin core shouldnt indicate type=submit or should avoid it because in this situation could bring problems with ajax and others submit buttons into the main form. I am not sure

[jQuery] Re: Dynamic Form Validation?

2007-08-24 Thread Mario Moura
Jörn Like I said I am not sure about this. Please I am not criticize anyone. I love your Validation. Works Fine. My form have a ajax button. Something like this form enctype=multipart/form-data id=myform method=post action=/send/invoice input type=submit class=form-submit value=Attach

[jQuery] Re: Dynamic Form Validation?

2007-08-24 Thread Jörn Zaefferer
Mario Moura schrieb: Jörn Like I said I am not sure about this. Please I am not criticize anyone. I love your Validation. Works Fine. My form have a ajax button. Something like this form enctype=multipart/form-data id=myform method=post action=/send/invoice input type=submit

[jQuery] Re: Dynamic Form Validation?

2007-08-23 Thread SeViR
Jörn Zaefferer escribió: howa schrieb: Hello, anyone has idea how to do dynamic form validation? e.g. using http://bassistance.de/jquery-plugins/jquery-plugin-validation/ input name=t1 type=text / input name=t2 type=text / I only want to check for required field for t2 ONLY if t1 is

[jQuery] Re: Dynamic Form Validation?

2007-08-23 Thread SeViR
Mario Moura escribió: Hi SeVir and Folks My form have a ajax button. Ajax button always is type=submit so I tested ValidationAide and Jquery Validation (bassistance.de http://bassistance.de) Both plugins have the following bad behavior. When I click in Ajax Button (value=Attach

[jQuery] Re: Dynamic Form Validation?

2007-08-23 Thread Mario Moura
Hi SeVir and Jörn, Yes I was thinking about this tonight. I need avoid the click event. $(#attach-button).each(function(){ $(this).bind(click, function(){ $(#node-form)[0].submit(); return false; }); }); I tested your function but I can

[jQuery] Re: Dynamic Form Validation?

2007-08-23 Thread Olaf Bosch
Mario Moura schrieb: Yes I was thinking about this tonight. I need avoid the click event. $(#attach-button).each(function(){ ... each ID are FALSE ;) ID are uniq!!! try so: $(.attach-button).each(function(){ And give a Class -- Viele Grüße, Olaf

[jQuery] Re: Dynamic Form Validation?

2007-08-23 Thread SeViR
Mario Moura escribió: Hi SeVir and Jörn, Yes I was thinking about this tonight. I need avoid the click event. $(#attach-button).each(function(){ $(this).bind(click, function(){ $(#node-form)[0].submit(); return false; }); }); First,

[jQuery] Re: Dynamic Form Validation?

2007-08-22 Thread Mario Moura
Hi SeVir and Folks My form have a ajax button. Ajax button always is type=submit so I tested ValidationAide and Jquery Validation (bassistance.de) Both plugins have the following bad behavior. When I click in Ajax Button (value=Attach id=attach-button name=attach) both think that I am trying

[jQuery] Re: Dynamic Form Validation?

2007-08-22 Thread Jörn Zaefferer
howa schrieb: Hello, anyone has idea how to do dynamic form validation? e.g. using http://bassistance.de/jquery-plugins/jquery-plugin-validation/ input name=t1 type=text / input name=t2 type=text / I only want to check for required field for t2 ONLY if t1 is equal to some value e.g. If

[jQuery] Re: Dynamic Form Validation?

2007-08-17 Thread SeViR
I suppose that you need a custom rule due to validation plugin don't support relations between fields. With jQuery.YAV (http://jquery.com/plugins/project/jquery_yav) I can do: input id=t1 name=t1 type=text class=equal alt={params:'some_value', require: 'pre-condition', condition:

[jQuery] Re: Dynamic Form Validation?

2007-08-17 Thread Mario Moura
Hi take a look http://dnaide.blogspot.com/2007/05/validationaide-easy-as-client-side-form.html BrowserSide validation. Very good. Regards Mario 2007/8/17, SeViR [EMAIL PROTECTED]: I suppose that you need a custom rule due to validation plugin don't support relations between fields.