...

View Full Version : Dropdown without Go Button



Dalziel
02-21-2003, 11: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, 12:31 PM
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, 03: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, 03:20 PM
This belongs in the Javascript forum....

Ding Ding...

poccil
02-21-2003, 03: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, 07:15 AM
still not actually using PHP, just refering to the page ...

Jesh
02-23-2003, 08:16 PM
Its still in the PHP Forum

Ding Ding...

Jesh
02-23-2003, 08:17 PM
Well there is still a link to it in the PHP Forum

Dong Dong

Spookster
02-24-2003, 12:24 AM
Well of course it's still linked in the PHP forum

Ding Dong

:)

cg9com
02-24-2003, 03:33 AM
Jesh, what i meant was the code supplied above wasnt PHP.
If that's even what you were talking about.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum