||10-02-2008 05:54 PM
Load url on select, via drop down menu
Ok, my title pretty much says it all. I need to create a drop down menu with the titles of the pages I need to load. The pages are being included with a $_GET command and a switch statement. The page inclusion works good. I just need to create the drop down menu and have it load the $_GET requests when their selected. Help please?
I already have something like this:
<option value=\"change_auth_level\">Change auth level</option>
<option value=\"email_activation\">Email activation settings</option>
||10-02-2008 06:22 PM
I have coded the following for you. With this HTML code:
<body onload="TalkPHP_Dropdown_Select.init();"> <select name="page" id="page"> <option>
Choose one...</option> <option value="auth_level.php">
Change auth level</option> <option value="email_settings.php">
Email activation settings</option> </select></body>
var TalkPHP_Dropdown_Select =
TalkPHP_Dropdown_Select.Address = 'http://www.talkphp.com/';
TalkPHP_Dropdown_Select.Target = document.getElementById('page');
TalkPHP_Dropdown_Select.Target.onchange = function()
var pTarget = TalkPHP_Dropdown_Select.Target;
var szValue = pTarget.options[pTarget.selectedIndex].getAttribute('value');
if (szValue == null)
location.href = TalkPHP_Dropdown_Select.Address + szValue;
It should produce something similar to what you're after. I hope it helps!
||10-03-2008 05:39 AM
Wow, that worked perfect. Thank you very much!
|All times are GMT. The time now is 02:05 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0