Click to See Complete Forum and Search --> : Drop menu help


DementiaSyde
12-12-2002, 02:06 PM
Hi. I was wondering if someone could help me code my menu? I have it coded, but when a user clicks on the link, it changes from the current page to the new one. What i would like, is to have the new page open in a new window. Here is an example of my script. Where and how would i make this happen?

<select class="combobox" name="SiteMap" onchange="if(options[selectedIndex].value){location = options[selectedIndex].value}" size="1">
<option selected>Misc. </option>
<option value="http://chat-forum.com/">Free Chat Room</option><option value="http://www.illusivedesign.org/">Web Templates 1</option><option value="http://4templates.com/">Web Templates 2</option>
</select>


Thanks in advance

Charles
12-12-2002, 02:31 PM
I don't know where you are posting from, but in my country, the United States, federal accessibility laws apply to the internet and require that you not rely upon JavaScript for navigation. And between 1 and 2 in ten people do not use JavaScript and that doesn't count the number of people who are not using a mouse. This method will work on all browsers and keep you out of court:

<!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>Form Navigation</title>
<form action="link.pl" target="_blank" name="myForm">
<div>
<select class="combobox" name="SiteMap" size="1">
<option selected>Misc. </option>
<option value="http://chat-forum.com/">Free Chat Room</option>
<option value="http:// www.illusivedesign.org/">Web Templates 1</option>
<option value="http:// 4templates.com/">Web Templates 2</option>
</select>
<input type="submit" value="Darling, you send me...">
</div>
</form>

And then get running something like the following and named something like "link.pl":

#!usr/local/bin/perl
use CGI qw(param redirect);
print redirect param 'SiteMap';

DementiaSyde
12-12-2002, 02:45 PM
i got it to open in a new window. but it links back to the hiome page. i dont understand the "link.pl" line in the code. explain?

Charles
12-12-2002, 02:53 PM
Forms are supposed to 'submit' their information to a program or script at some URL. The value of the ACTION attribute sets that URL for the form. The last three lines of my post are a little script that will take the information from your form and then, politely I suppose, tell your browser where to go. That's what's supposed to be named 'link.pl'. You can do the same thing with other scripting languages if you don't have Perl available. In any case you will need to talk to your server f&uuml;hrer to get things set up properly.

DementiaSyde
12-12-2002, 02:55 PM
okay, thanks