Hi,
The following is a very tiny sample script in which I would like the selected results to open in a new window.
All I need is for someone to put that command in the right place, and unfortunately, I don’t even know what the command should look like.
My gratitude and a handshake to whoever answers.
I’m quite sure it will be in the <head></head> section, but here ya go:
[code=php]<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<title>New Page 1</title>
<script type=”text/javascript”><!–
function surfto(n){
eval(‘th=document.getElementById(“form’+n+'”).select;’);
if(th.options.selectedIndex!=0){
location.href=th.options[th.selectedIndex].value;}}
//–></script>
</head>
<body>
<p align=”center”>
<form id=”form1″>
<select id=”select” onchange=”surfto(‘1’)”>
<option selected=”selected”>Select Item—> </option>
<option value=”http://www.google.com”>Google</option>
</select>
</form>
<p>
<form id=”form2″>
<select id=”select” onchange=”surfto(‘2’)”>
<option selected=”selected”>Select Item—> </option>
<option value=”http://www.yahoo.com”>Yahoo</option>
</select>
</form>
<p>
<!– Notice the two event handlers; onchange=”surfto(‘1’)” and onchange=”surfto(‘2’)”.
Make sure that the numbers in them are the same as the numbers in the appropraite form id; id=”form1″ and id=”form2″. –>
</body>
</html>