/    Sign up×
Community /Pin to ProfileBookmark

Undefined URL (new window)

I’ve got a problem with a script I put together a couple of years back — at sometime it worked, I’m not sure what might have thrown it off.

A live example of the script can be found at:
[url]http://topsitenet.com/cgi-bin/addaurl.cgi?listid=znzfzk[/url]

What’s supposed to happen is when a user selects a category, a new window opens up and allows them to select sub-categories. Well instead of loading the defined URL’s with each category, it simply loads an “undefined” url.

Below are snippets of code associated with this project.

[B]The Javascript:[/B]
function small_window(myurl) {
if(myurl.options[myurl.selectedIndex].value != “”) {
jumpto=myurl.options[myurl.selectedIndex].nvalue
var newWindow;
var props = ‘scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=300,height=200’;
newWindow = window.open(jumpto, “Add_from_Src_to_Dest”, props); }
}

[B]The HTML:[/B]
<select size=”1″ name=”level01″onchange=” javascript:small_window(this);”><option>Top-Level Category</option>
<option value=”Animals” nvalue=”http://topsitenet.com/cgi-bin/addaurl.cgi?listid=znzfzk&level01=Animals” >Animals</option>
ect…

It would be great if someone could help me out with this, i’d really appreciate it. All I need the script to do is pass the nvalue url through the javascript and open it in a new window.

Thanks so much.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Nov 26.2006 — jumpto=myurl.options[myurl.selectedIndex].nvalue

there is a typo, there is no nvalue property, but there is a value!

Eric
Copy linkTweet thisAlerts:
@topsitenetauthorNov 26.2006 — The nvalue property (the url users should be directed to) is defined in the <select> pull-down menu, example:

<option value="Animals" nvalue="http://topsitenet.com/cgi-bin/addaurl.cgi?listid=znzfzk&level01=Animals" >Animals</option>

Or am I just not understanding what exactly you're saying? My javascript skills are novice/intermediate, can you explain further? What exactly I need to do/change to make the script work?

Nick
×

Success!

Help @topsitenet 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,
)...