Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 29th, 2006, 4:31 PM   #1
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
DropDown Box .

Hi ,

Please How can i make links in a drop down box ,

as an example :

i have the entries "1,2,3"
so i want when i click on 1 it goes to a page and 2 to anther page etc ..

please any one help me
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Old Jul 29th, 2006, 5:29 PM   #2
B3TA_SCR1PT3R
Hobbyist Programmer
 
B3TA_SCR1PT3R's Avatar
 
Join Date: Jul 2005
Location: Dallas, Texas
Posts: 101
Rep Power: 0 B3TA_SCR1PT3R is an unknown quantity at this point
Send a message via AIM to B3TA_SCR1PT3R
http://www.google.com/search?hl=en&q...=Google+Search

[html]
<form name="numz">
<select name="menu" onChange="location=document.numz.menu.options[document.numz.menu.selectedIndex].value;">
<option value="http://google.com">google</option>
<option value="http://yahoo.com">yahoo</option>
<option value="http://programmingforums.org">pfo</option>
</select>
</form>
[/html]

//edit, didnt really read your post, fixed it to link
__________________
Hoes telling me to calm down but I'm like fuck that shit!
B3TA_SCR1PT3R is offline   Reply With Quote
Old Jul 30th, 2006, 7:12 AM   #3
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
oooh , so the value can be a link to anther site , i didnt know that i thought its a only a value of the variable in the option command
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Old Jul 30th, 2006, 7:36 AM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by ASHORY
oooh , so the value can be a link to anther site , i didnt know that i thought its a only a value of the variable in the option command
It is only a value. The javascript in the onChange attribute does the magic:
onChange="location=document.numz.menu.options[document.numz.menu.selectedIndex].value;"
Arevos is offline   Reply With Quote
Old Jul 30th, 2006, 2:26 PM   #5
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
ok so how can i make the same example but with a popup window
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Old Jul 30th, 2006, 2:34 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Change the "location = " to a function call to "popup".

This is an adaptation of DaWei's popup function.

function popup(wURL,w,h,wID)
{
    var specs = "width="+w+",height="+h+",top=10,left=10," +
	        "screenx=10,screeny=10," +
	        "resizable=yes,scrollbars=no,statusbar=no";
    popWin = open(wURL, wID, specs);
    popWin.focus ();
    return popWin;
}

And in that function call, the first paramter will be "document.numz.menu.options[document.numz.menu.selectedIndex].value", the second and third is the width/height of the popup, and the fourth is a unique identifier to make multiple popups in the same/different popup window.

If you're familiar with javascript, it should be quite easy to set up. If you're not, post back and I can give a little more information on how abouts to do it.

But don't give up right away just because I said that . . .
Sane is offline   Reply With Quote
Old Jul 31st, 2006, 1:45 PM   #7
ASHORY
Programmer
 
ASHORY's Avatar
 
Join Date: Dec 2004
Location: Egypt
Posts: 30
Rep Power: 0 ASHORY is on a distinguished road
Send a message via ICQ to ASHORY Send a message via MSN to ASHORY Send a message via Yahoo to ASHORY
thanks sane ,

really iam not good in javascript but i think that i got it , any way i'll post here if i needed any other help
__________________
"^Ahmed.SHOukRY^"
http://www.ashory.741.com
ASHORY is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dropdown menu with persistence? kerriganm HTML / XHTML / CSS 11 Dec 17th, 2005 2:33 PM
Java Disable Dropdown List Ghost Java 2 Nov 10th, 2005 8:34 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC