Forum Moderators: open

Message Too Old, No Replies

Radio button pre select problem

         

eternal

4:21 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



I am using the following to allow users to make a selection and link to that selection on submit.

I would like the second radio button to be pre-selected when the page loads is this possible .. I tried "checked" but that didnt work!

<form style="margin:0px; padding:0px; " method="get" action="">
Choose Your Subscription:
<input type="radio" name="1" value="soLogin.php" selected="selected" onclick="this.form.action=this.value;" />
<input type="radio" name="1" value="newUser.php" selected="selected" onclick="this.form.action=this.value;" />
<input class="submit" type="submit" value="CONTINUE" />
</form>

RonPK

8:13 pm on Oct 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

* a digit is not a valid name
* selected is not a property of radio buttons

checked="checked" should work just fine. It can of course only be used on one of the buttons in a set.

rocknbil

6:33 pm on Oct 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also you can't BEGIN an object name with a digit if it's to be accessed by Javascript, as in 1_action, so don't try it. :-) Use action_1 if you need to.