|
-
Apr 8th, 2002, 02:24 PM
#1
Thread Starter
Member
option button problem
I have webpage with 1 dropdownbox and 2 option buttons. The dropdownlist contains the values tot, mar, mam, om, bes, sja. If I click radio button 1 then for example the page tot1 has to be loaded in the page called mainframe.html. If I click radio button 2 and pick mar in the dropdownlist then mar2 has to be loaded. See for my code below.
My question is how to accomplish this because the code below does not work. It works well without the radio buttons but how can I make it work with the radio buttons so I can load 12 different pages (tot1, mar1, mam1, om1, bes1, sja1, tot2, mar2, mam2, om2, bes2, sja2)
<HTML>
<HEAD>
<script language="JavaScript">
function doArray() {
var arylnth = doArray.arguments.length;
for ( i = 0 ; i < arylnth ; i++ ) { this[i]=doArray.arguments[i] } }
function newpage() {
var choose = eval(document.dropdown.site.selectedIndex); if( (choose > 0) && (choose <
12) ) {
var section=new doArray( '',
'tot' + radio' + '.html',
'mar' + radio + '.html',
'mam' + radio + '.html',
'om' + radio + '.html',
'bes' + radio + '.html',
'sja' + radio + '.html');
top.mainframe.location = section[document.dropdown.site.selectedIndex];
}
}
</script>
<TITLE></TITLE>
</HEAD>
<BODY>
<form name="dropdown" target="mainframe">
<p><select name="site" size="1" onchange="newpage();"
align="left">
<option selected>Afdeling.... </option>
<option>Tot</option>
<option>Mar</option>
<option>Mam</option>
<option>Oma</option>
<option>Bes</option>
<option>Sja</option>
</select> </p>
<P><INPUT type=radio name=radio value=1><INPUT type=radio name=radio value=2></P>
</form>
</BODY>
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|