Forum Moderators: open

Message Too Old, No Replies

Value = Checked for Radio Button

start it off checked

         

RichDiaz

6:58 pm on Dec 5, 2001 (gmt 0)



how do i set a readio button to checked right when the user gets to my webpage?

------------------
<INPUT TYPE = Radio
NAME =formProgram value=formAffiliate>
Affiliate Program ¦

<INPUT TYPE = Radio
NAME =formProgram value = formDealer>
Dealer ¦

------------------
thanks =)

seriesint

7:33 pm on Dec 5, 2001 (gmt 0)



Hi,

Try checked just like for a checkbox but just define it for one of the radio group
<input type="radio" name="radgrp" value="zero" >zero
<input type="radio" name="radgrp" value="one" checked>one
<input type="radio" name="radgrp" value="two" >two

HTH
later

RichDiaz

10:09 pm on Dec 5, 2001 (gmt 0)



thanks a bunch, that did the trick =)

IanKelley

8:55 am on Dec 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If it matters to you... in order to be XHTML compliant you can't use empty attributes.

In other words use:
checked="checked"
instead of just 'checked'