Discussion Forums  >  Uncategorized

Replies: 2    Views: 346

Walms
Code is Art
Profile
Posts: 235
Reg: Aug 24, 2011
Derby
3,300
10/12/11 08:09 AM (14 years ago)

HTML/Javascript guru needed!

Im wanting to have a select list which automatically redirects users to a url. I reckon the basic code should look something like this: <SCRIPT LANGUAGE=JavaScript> function getURL(form) { // get the value of the selected option var url = form.selURL.options[form.selURL.selectedIndex].value; // go there location.href = url; </SCRIPT> <FORM> <SELECT NAME=selURL onChange=getURL(this.form);> <OPTION VALUE=http://www.google.co.uk>google <OPTION VALUE=http://www.facebook.co.uk>facebook </FORM> but I would like user to redirect to either url depending on which option is selected. Its above my skill level so could do with a little help!!!!!
 
Parker @ buzztouch
buzztouch Evangelist
Profile
Posts: 1395
Reg: May 09, 2011
Pacific Grove, ...
24,500
like
10/12/11 06:04 PM (14 years ago)
Hi BBP, Google to the rescue! See if this helps you out: http://www.davesite.com/webstation/js/theory1jump.shtml
 
Walms
Code is Art
Profile
Posts: 235
Reg: Aug 24, 2011
Derby
3,300
like
10/13/11 09:05 AM (14 years ago)
great help as usual :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.