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, 2008 at 5:24 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Thanks for this feedback but that is what I'm trying and the radio
> button is empty. My script is
>
> <script type="text/javascript">
>        $(document).ready(function() {
>                 $('#Demo[value="EasyOrder Basic"]').attr('checked', true);
>        });
> </script>
>
> and the URL is
>
> http://www.remanresource.com/signup.php?SubscrIDP=5
>
> Thanks, - Dave
>
> On May 19, 8:34 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
>> 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 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 suggestions are greatly appreciated, - Dave
>>
>> > On May 19, 7:56 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
>> >> Assuming the following:
>>
>> >>   <input type="radio" name="someName" id="Demo" value="hello">
>>
>> >> 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]
>>
>> >> <[EMAIL PROTECTED]> wrote:
>>
>> >> > Hi,
>>
>> >> > When my page loads, I'd like to check a radio button whose ids are
>> >> > "Demo" and whose value is "hello".  How do I do this with JQuery?
>>
>> >> > Thanks, - Dave- Hide quoted text -
>>
>> >> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
>

Reply via email to