Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default RadioButton!?!

Status
Not open for further replies.

WidowMaker

IS-IT--Management
Jun 30, 2001
12
0
0
DK
Hey,
I got a small problem:
I would like to set a default RadioButton on my Homepage. I read all my setting from INI-files and write them back if changed. How do I set the default RadioButton? And I'm not thinking of:
<INPUT TYPE=RADIO NAME=SOMERADIO VALUE=&quot;1&quot; checked> 1st

I know how to do it with Check- and listboxex

Checkbox:
SOMEFORM.SOMECHECKBOX.checked = true
Listbox:
window.SOMEFORM.SOMELISTBOX.value = &quot;Value&quot;

ThnX :)
 
U have to use like
SOMEFORM.SOMECHECKBOX.checked = true
for radio buttons

SOMEFORM.SOMERADIO.checked=true ________

George
 
Well, with radio buttons you usually have array - one and the same name for each radio button, different values.
So if you want to check programmatically one of them the code will be:
SOMEFORM.SOMERADIO[5].checked = true;
D.
 
Hmm, can't get it to work :(

<HTML>
<HEAD>
<TITLE> type_Document_Title_here </TITLE>
</HEAD>
<BODY>

<form name=&quot;SOMEFORM&quot; method=&quot;post&quot;>

<INPUT TYPE=RADIO NAME=SOMERADIO VALUE=&quot;1&quot; >&nbsp;1st<BR>
<INPUT TYPE=RADIO NAME=SOMERADIO VALUE=&quot;2&quot; >&nbsp;2nd<BR>
<INPUT TYPE=RADIO NAME=SOMERADIO VALUE=&quot;3&quot; >&nbsp;3rd<BR>

<SCRIPT language=&quot;vbscript&quot;>
SOMEFORM.SOMERADIO[1].checked = true;
</SCRIPT>

</form>

</BODY>
</HTML>
 
Sorry, I gave JavaScript version of array.
in VBScript it is collection and syntax is little bit different.

<SCRIPT language=&quot;vbscript&quot;>
SOMEFORM.SOMERADIO(1).checked = true
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top