[jQuery] Re: Forms and syntax: Radio buttons and tutorials?

2008-07-21 Thread Micky Hulse

Ok, I need to stop floundering around!

Hehe... This is what I wanted:

if($('#option02').is(':checked'))

I think I need to read the docs... jQuery site is down for me
though... Anyway, I am still looking for links to jQuery form
tutorials! :)

Have a great day all.

Micky

On Jul 20, 11:57 am, Micky Hulse <[EMAIL PROTECTED]> wrote:
> I guess this would be even better:
>
> $("#option01:checked")
>
> Not sure why I did not think of that earlier. :)
>
> On Jul 20, 11:53 am, Micky Hulse <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have a form (#fmSearch) with three radio buttons:
>
> >  ...
> >  ...
> >  ...
>
> > When testing for a specific radio button, which of the below
> > techniques is faster/better?
>
> > $('#option01').attr('checked', 'checked');
>
> > or
>
> > $("[EMAIL PROTECTED]'option01']:checked")
>
> > If I had to guess, I would say the the first option is faster... but I
> > like the readability of the second one better.
>
> > Anyone know of a good tutorial that details how to wok with forms
> > using jQuery (sans-plugins)?
>
> > Many thanks in advance!
>
> > Cheers,
> > Micky


[jQuery] Re: Forms and syntax: Radio buttons and tutorials?

2008-07-20 Thread Yehuda Katz
This would work too:

if($("#option02:checked").length)

-- Yehuda

On Sun, Jul 20, 2008 at 3:51 PM, Micky Hulse <[EMAIL PROTECTED]>
wrote:

>
> Ok, I need to stop floundering around!
>
> Hehe... This is what I wanted:
>
> if($('#option02').is(':checked'))
>
> I think I need to read the docs... jQuery site is down for me
> though... Anyway, I am still looking for links to jQuery form
> tutorials! :)
>
> Have a great day all.
>
> Micky
>
> On Jul 20, 11:57 am, Micky Hulse <[EMAIL PROTECTED]> wrote:
> > I guess this would be even better:
> >
> > $("#option01:checked")
> >
> > Not sure why I did not think of that earlier. :)
> >
> > On Jul 20, 11:53 am, Micky Hulse <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > I have a form (#fmSearch) with three radio buttons:
> >
> > >  ...
> > >  ...
> > >  ...
> >
> > > When testing for a specific radio button, which of the below
> > > techniques is faster/better?
> >
> > > $('#option01').attr('checked', 'checked');
> >
> > > or
> >
> > > $("[EMAIL PROTECTED]'option01']:checked")
> >
> > > If I had to guess, I would say the the first option is faster... but I
> > > like the readability of the second one better.
> >
> > > Anyone know of a good tutorial that details how to wok with forms
> > > using jQuery (sans-plugins)?
> >
> > > Many thanks in advance!
> >
> > > Cheers,
> > > Micky
>



-- 
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


[jQuery] Re: Forms and syntax: Radio buttons and tutorials?

2008-07-20 Thread Micky Hulse

I guess this would be even better:

$("#option01:checked")

Not sure why I did not think of that earlier. :)

On Jul 20, 11:53 am, Micky Hulse <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a form (#fmSearch) with three radio buttons:
>
>  ...
>  ...
>  ...
>
> When testing for a specific radio button, which of the below
> techniques is faster/better?
>
> $('#option01').attr('checked', 'checked');
>
> or
>
> $("[EMAIL PROTECTED]'option01']:checked")
>
> If I had to guess, I would say the the first option is faster... but I
> like the readability of the second one better.
>
> Anyone know of a good tutorial that details how to wok with forms
> using jQuery (sans-plugins)?
>
> Many thanks in advance!
>
> Cheers,
> Micky