/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CharlesDec 12.2002 — [font=georgia]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:

[font=monospace]

<!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>

[/font]

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

[font=monospace]

#!usr/local/bin/perl

use CGI qw(param redirect);

print redirect param 'SiteMap';

[/font][/font]
Copy linkTweet thisAlerts:
@DementiaSydeauthorDec 12.2002 — 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?
Copy linkTweet thisAlerts:
@CharlesDec 12.2002 — [font=georgia]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.[/font]
Copy linkTweet thisAlerts:
@DementiaSydeauthorDec 12.2002 — okay, thanks
×

Success!

Help @DementiaSyde spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...