Click to See Complete Forum and Search --> : Lost Link


spuddy
12-29-2002, 11:43 AM
I have placed a drop down box into my site but when I do a test on the page an error is highlighted stating that the following link is not found (options[selectedIndex].value)

I have copied below the code that I have used and would be grateful for any assistance. the page that the code is used is www.doncaster40.freeserve.co.uk/centimentalbears.html should you need to look at the source.


<table border=1 width=20% cellspacing=4 cellpadding=4 bgcolor=FFFFCC cols=2><tr><td>
<center><FORM><SELECT name="URL" onChange="if(options[selectedIndex].value) window.location.href= (options[selectedIndex].value)"> <OPTION value="">Centimental Bears For Sale</OPTION><OPTION> </OPTION>
</SELECT><NOSCRIPT><INPUT type=submit value="Go"></NOSCRIPT></FORM></center></td></tr></table>

Charles
12-29-2002, 12:10 PM
And if you do get it to work, What of the more than 1 in 10 users that do not use JavaScript? Use somehting like the following instead:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example</title>
<form action="test.html">
<div>
<select name="url">
<option value="http://www.w3.org/TR/REC-html32">HTML 3.2</option>
<option value="http://www.w3.org/TR/html4/">HTML 4.01</option>
</select>
<input type="submit" value="Darling, you send me.">
</div>
</form>

And then get something like the following named 'link.pl' and up and running on the server:

use CGI qw(redirect param);
print redirect param 'url';

Charles
12-29-2002, 01:46 PM
Yes, thanks. That got changed during the quality control phase and I forgot to change it back.