View Full Version : Dropdown without Go Button
Dalziel
02-21-2003, 10:51 AM
I would prefer to use PHP over Javascript but I don't know if what I want to do is possible with PHP or how to do it if it is, what I want is a dropdown and when you select an option from it, you are automatically taken to another page (no button to click) is that possible without JS?
anurag_shr
02-21-2003, 11:31 AM
no i dont think it ispossible with out javascript. But by using javascript your object has been solved , onchange event of select , is used in that case. If u get the way without useingjavascript then plz let me know.
thody
02-21-2003, 02:07 PM
anurag_shr is right. PHP is a server-side language, what you're describing is a client-side behaviour. Once the page is loaded in your browser, forget PHP. It's simple enough to do with JS using the onChange method as mentioned.
Cheers.
Spookster
02-21-2003, 02:20 PM
This belongs in the Javascript forum....
Ding Ding...
poccil
02-21-2003, 02:50 PM
An example is on this very page:
<select name="forumid"
onchange="window.location=('forumdisplay.php?s=&daysprune=&forumid='+this.options[this.selectedIndex].value)">
<option value="-1" >Please select one:</option>
<option value="-1">--------------------</option>
<option value="pm" >Private Messages</option>
<option value="cp" >User Control Panel</option>
<!-- and so on -->
</select>
cg9com
02-23-2003, 06:15 AM
still not actually using PHP, just refering to the page ...
Its still in the PHP Forum
Ding Ding...
Well there is still a link to it in the PHP Forum
Dong Dong
Spookster
02-23-2003, 11:24 PM
Well of course it's still linked in the PHP forum
Ding Dong
:)
cg9com
02-24-2003, 02:33 AM
Jesh, what i meant was the code supplied above wasnt PHP.
If that's even what you were talking about.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.