[jQuery] Re: Checking a radio button

2008-05-20 Thread Karl Rudd
Right, the problem is that every radio button has the same id, remove them. You can use: $(':radio[value="EasyOrder Basic"]').attr('checked', true); On a side note, why do you need to check the radio button via JavaScript, why can't you check it on the server side? Karl Rudd On Wed, May 21, 2

[jQuery] Re: Checking a radio button

2008-05-20 Thread [EMAIL PROTECTED]
Thanks for this feedback but that is what I'm trying and the radio button is empty. My script is $(document).ready(function() { $('#Demo[value="EasyOrder Basic"]').attr('checked', true); }); and the URL is http://www.remanresource.com/signup.php?SubscrIDP=5 T

[jQuery] Re: Checking a radio button

2008-05-19 Thread Karl Rudd
Remember to be careful how you mix the various quotes ' and ". The following should work. $('#Demo[value="hello there"]').attr('checked', true); Karl Rudd On Tue, May 20, 2008 at 11:33 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I may have spoken a little too soon. Karl, that was a gr

[jQuery] Re: Checking a radio button

2008-05-19 Thread [EMAIL PROTECTED]
I may have spoken a little too soon. Karl, that was a great solution, but what if the part of the value clause has a space in it? This isn't working for me ... $('#Demo[value=hello there]').attr('checked', true); nor is this ... $('#Demo[value="hello there"]').attr('checked', true); Any sugg

[jQuery] Re: Checking a radio button

2008-05-19 Thread Karl Rudd
Just remember that you shouldn't have more than one element on the page with the same id. For example is something that will cause problems: Karl Rudd On Tue, May 20, 2008 at 11:16 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Thanks, Karl. Your second solution was the one I was look

[jQuery] Re: Checking a radio button

2008-05-19 Thread [EMAIL PROTECTED]
Thanks, Karl. Your second solution was the one I was looking for. - Dave On May 19, 7:56 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote: > Assuming the following: > >   > > The following will "check" the radio button: > >   $('#Demo').attr('checked', true); > > If you _really_ need to ONLY check the

[jQuery] Re: Checking a radio button

2008-05-19 Thread Karl Rudd
Assuming the following: The following will "check" the radio button: $('#Demo').attr('checked', true); If you _really_ need to ONLY check the radio button if it's got an id="Demo" AND value="hello": $('#Demo[value=hello]') Karl Rudd On Tue, May 20, 2008 at 8:47 AM, [EMAIL PROTECTED]

[jQuery] Re: Checking a radio button

2008-05-19 Thread Jarques
Radio buttons can be checked by document.getElementById("Demo").checked = true; So I believe you can do the following on page load: $check = document.getElementById("Demo"); if ($check.checked == true) { Do what you want to do here. } On May 19, 3:47 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED