fairwinds
09-30-2002, 08:52 AM
A newbie question. I am trying to use an OnClick event in a menu to direct to a url that is composed of two strings. The first string is obtained from an option menu, the second part from a radio button. Problem is to concatenate them so that the onclick is done for the complete url.
Here's what I have:
<form name="menu">
<p>
<select name="component" size="1">
<option selected value="http://url1">modules</option>
<option value="http://url2">variables</option>
</select>
<input type="radio" name="menuaction" value="_new" checked>
New
<input type="radio" name="menuaction" value="_view">
View
<input type="button" value="Go" onClick="location=document.menu.component.options[document.menu.component.selectedIndex].value" + "location=document.menu.menuaction.value">
</p>
</form>
the idea is to be able to select from the option list and pick one of new or view and then click go button to go to the url that is made of the two strings.
Can someone tell me what I am doing wrong?
:confused:
Here's what I have:
<form name="menu">
<p>
<select name="component" size="1">
<option selected value="http://url1">modules</option>
<option value="http://url2">variables</option>
</select>
<input type="radio" name="menuaction" value="_new" checked>
New
<input type="radio" name="menuaction" value="_view">
View
<input type="button" value="Go" onClick="location=document.menu.component.options[document.menu.component.selectedIndex].value" + "location=document.menu.menuaction.value">
</p>
</form>
the idea is to be able to select from the option list and pick one of new or view and then click go button to go to the url that is made of the two strings.
Can someone tell me what I am doing wrong?
:confused: