[jQuery] Re: Better way to select parent form?

2007-07-18 Thread RobG
On Jul 19, 9:13 am, jarrod <[EMAIL PROTECTED]> wrote: > I'm trying to write a script that responds to a keyup event in any field of a > given form. If the form is valid, the submit button of that form is enabled. > The problem is that there are several forms on the page. My script has to > enabl

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread jarrod
Richard D. Worth-2 wrote: > >> I haven't found anywhere in the docs that talks about using this selector >> thing $() with two arguments. What exactly is going on there? > > > See http://docs.jquery.com/Core#.24.28_expr.2C_context_.29 > > "By default, if no context is specified, $() looks fo

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Richard D. Worth
On 7/18/07, jarrod <[EMAIL PROTECTED]> wrote: I don't understand this part: > var input = $('[EMAIL PROTECTED]', form); Specifically this: "$('[EMAIL PROTECTED]', form);" I haven't found anywhere in the docs that talks about using this selector thing $() with two arguments. What exactly i

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread jarrod
I don't understand this part: > var input = $('[EMAIL PROTECTED]', form); Specifically this: "$('[EMAIL PROTECTED]', form);" I haven't found anywhere in the docs that talks about using this selector thing $() with two arguments. What exactly is going on there? > Also may I ask why you're

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Klaus Hartl
Klaus Hartl wrote: jarrod wrote: I'm trying to write a script that responds to a keyup event in any field of a given form. If the form is valid, the submit button of that form is enabled. The problem is that there are several forms on the page. My script has to enable the right one. I hav

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Erik Beeson
Maybe you want something like: $thisSubmit = $('#myinput').parents('form').find('[EMAIL PROTECTED]"submit"]'); --Erik On 7/18/07, jarrod <[EMAIL PROTECTED]> wrote: Erik Beeson wrote: > > >> $this = $("#myinput"); >> $thisForm = $("form",$this.parent()) > > I didn't really read the OP, but

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Klaus Hartl
jarrod wrote: I'm trying to write a script that responds to a keyup event in any field of a given form. If the form is valid, the submit button of that form is enabled. The problem is that there are several forms on the page. My script has to enable the right one. I have a way that works, but

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread jarrod
Erik Beeson wrote: > > >> $this = $("#myinput"); >> $thisForm = $("form",$this.parent()) > > I didn't really read the OP, but I think that's the same as: > > $thisForm = $('#myinput').parent().find('form'); > > Or at that point, might as well do: > > $thisSubmit = $('#myinput').siblings('[

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Erik Beeson
$this = $("#myinput"); $thisForm = $("form",$this.parent()) I didn't really read the OP, but I think that's the same as: $thisForm = $('#myinput').parent().find('form'); Or at that point, might as well do: $thisSubmit = $('#myinput').siblings('[EMAIL PROTECTED]"submit"]'); --Erik

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Alexandre Plennevaux
Mmmh: $this = $("#myinput"); $thisForm = $("form",$this.parent()) -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jarrod Sent: jeudi 19 juillet 2007 0:14 To: jquery-en@googlegroups.com Subject: [jQuery] Better way to select parent form? I'm