Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 3rd, 2005, 11:20 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
hidden type with drop down menu

I am trying to get a drop down box to GOTO a section in my website. It does not work.

in the <HEAD>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</HEAD>

in the <BODY>

<form name="form1">
<input type="Hidden" name="authorize" value="<?php echo $authorize ?>">
<input type="Hidden" name="a" value="<?php echo $act ?>">
<input type="Hidden" name="id" value="<?php echo $id ?>">
<input type="Hidden" name="i" value="<?php echo $userid ?>">
<select name="select" onChange="MM_jumpMenu('parent',this,0)">
<option value="p.php" selected>Main Menu</option>
<option value="pann3.php">Announcements</option>
</select>
</form>

Reply With Quote
  #2  
Old April 5th, 2005, 04:59 AM
jweizenblut jweizenblut is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Miami, Fl. US
Posts: 522 jweizenblut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 29 sec
Reputation Power: 2
Send a message via AIM to jweizenblut Send a message via Yahoo to jweizenblut
RE: hidden type with drop down menu

If I am understanding you properly, you want to have a drop-down, that based on the selection would go to a different page. If that is the case, here is some code that will work:

Function for the Header Section:

function GoToLink()
{
FormGoto = document.YOUR_FORM_NAME.SELECT_NAME;
SelectedLink = FormGoto.options[FormGoto.selectedIndex].value;
Length = FormGoto.length -1;
SampleLink = FormGoto.selectedIndex;
if (SampleLink == Length)
{
window.open(SelectedLink)
}
else
{
self.location = SelectedLink
}
}

Code for you drop-down select:

<select name="SELECT_NAME" onChange="javascript:GoToLink()">
<option value="1STPAGE.PHP">TEXT TO DISPLAY IN DROP-DOWN</option>
<option value="2STPAGE.PHP">TEXT TO DISPLAY IN DROP-DOWN</option>
</select>

If you want to have the first option of the drop-down be a CLICK HERE for option, or something like that, simply leave the option value at "" and it won't do anything.

The code would, of course need some minor tweaking for you. Right now, it opens a new window, you could modify that. The only problem I kind of see right now is the hidden values you are trying to pass, which is similar to the problem I had since this is not doing a POST. What you could do is use SESSION to store those values and read them in the next page from the SESSION.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > hidden type with drop down menu


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT