473,796 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Double drop-down boxes display problem

1 New Member
Hi,

I'd like to put a double drop-down menu on my webpage and instead of a redirection to a new webpage, I'd like to display the result in a new section. I'm kind of stuck and I only have a triple menu here. Here an exemple of what I need.

(menu)Size, (menu) color and then display the price somewhere in a box.

Thanks a bunch

Bob


[HTML]<body>
<center>
<FORM name="isc">
<table border="0" cellspacing="0" cellpadding="0" >
<tr align="center">
<td nowrap height="11">

<select name="example" size="1" onChange="redir ect(this.option s.selectedIndex )">
<option selected>Boat lenghts</option>
<option>6-10 M</option>
<option>10-13 M</option>
<option>13-16 M</option>
<option>16+ M</option>
</select>

<select name="stage2" size="1" onChange="redir ect1(this.optio ns.selectedInde x)">
<option value=" " selected>Dokcli nes lenghts </option>
</select>

<select name="stage3" size="1" onChange="redir ect2(this.optio ns.selectedInde x)">
<option value=" " selected> </option>
<option value=" " selected>---Select3----------------</option>
<option value=" " selected>---Select3----------------</option>
</select>

[/HTML]
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript"><!--
  2. /*
  3.  _____________________________________
  4. /ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\
  5. | Another JavaScript from Uncle Jim   |
  6. | Feel free to copy, use and change   |
  7. | this script as long as this part    |
  8. | remains unchanged. You can visit    |
  9. | my website at http://jdstiles.com   |
  10. | for more scripts like this one.     |
  11. | Created: 1996 Updated: 2006         |
  12. \_____________________________________/
  13.  ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
  14. */
  15. var groups=document.isc.example.options.length
  16. var group=new Array(groups)
  17. for (i=0; i<groups; i++)
  18. group[i]=new Array()
  19.  
  20. group[0][0]=new Option("---Select2---"," ");
  21.  
  22. group[1][0]=new Option("Now Select This One"," ");
  23. group[1][1]=new Option("MAIN ONE,SUB ONE","47");
  24. group[1][2]=new Option("MAIN ONE,SUB TWO","46");
  25. group[1][3]=new Option("MAIN ONE,SUB THREE","45");
  26.  
  27. group[2][0]=new Option("Now Select This One"," ");
  28. group[2][1]=new Option("MAIN TWO,SUB ONE","115");
  29. group[2][2]=new Option("MAIN TWO,SUB TWO","116"); 
  30. group[2][3]=new Option("MAIN TWO,SUB Three","117"); 
  31.  
  32. var temp=document.isc.stage2
  33.  
  34.  
  35. function redirect(x){
  36. for (m=temp.options.length-1;m>0;m--)
  37. temp.options[m]=null
  38. for (i=0;i<group[x].length;i++){
  39. temp.options[i]=new Option(group[x][i].text,group[x][i].value)
  40. }
  41. temp.options[0].selected=true
  42. redirect1(0)
  43. }
  44.  
  45.  
  46.  
  47. var secondGroups=document.isc.stage2.options.length
  48. var secondGroup=new Array(groups)
  49. for (i=0; i<groups; i++)  {
  50. secondGroup[i]=new Array(group[i].length)
  51. for (j=0; j<group[i].length; j++)  {
  52. secondGroup[i][j]=new Array()  }}
  53.  
  54. secondGroup[0][0][0]=new Option("---Select 3---"," ");
  55. secondGroup[1][0][0]=new Option("---Select 3---"," ");
  56. secondGroup[1][1][0]=new Option("Now Select This One"," ");
  57. secondGroup[1][1][1]=new Option("M1,S1,P1","navigation.html");
  58. secondGroup[1][1][2]=new Option("M1,S1,P2","effects.html");
  59. secondGroup[1][1][3]=new Option("M1,S1,P3","utilities.html");
  60.  
  61. secondGroup[1][2][0]=new Option("Now Select This One"," ");
  62. secondGroup[1][2][1]=new Option("M1,S2,P1","http://jdstiles.com/");
  63. secondGroup[1][2][2]=new Option("M1,S2,P2","http://jdstiles.com");
  64. secondGroup[1][2][3]=new Option("M1,S2,P3","http://jdstiles.com");
  65.  
  66. secondGroup[1][3][0]=new Option("Now Select This One"," ");
  67. secondGroup[1][3][1]=new Option("M1,S3,P1","http://www.cgi-resources.com");
  68. secondGroup[1][3][2]=new Option("M1,S3,P2","http://adashimar.hypermart.net/");
  69.  
  70. secondGroup[2][0][0]=new Option("---Select 3---"," ");
  71. secondGroup[2][1][0]=new Option("Now Select This One"," ");
  72. secondGroup[2][1][1]=new Option
  73. ("M2,S1,P1","http://www.cnn.com");
  74. secondGroup[2][1][2]=new Option("M2,S1,P2","http://www.msnbc.com");
  75. secondGroup[2][1][3]=new Option("M2,S1,P3","http://www.abcnews.com");
  76.  
  77. secondGroup[2][2][0]=new Option("Now Select A Page"," ");
  78. secondGroup[2][2][1]=new Option("M2,S2,P1","http://www.news.com");
  79. secondGroup[2][2][2]=new Option("M2,S2,P2","http://www.wired.com");
  80.  
  81. secondGroup[2][3][0]=new Option("Now Select A Page"," ");
  82. secondGroup[2][3][1]=new Option
  83. ("M2,S3,P1","http://www.jdstiles.com");
  84. secondGroup[2][3][2]=new Option
  85. ("M2,S3,P2","http://jdstiles.com/index1.html");
  86. secondGroup[2][3][3]=new Option
  87. ("M2,S3,P3","http://jdstiles.com/index2.html");
  88. secondGroup[2][3][4]=new Option("M2,S3,P4","http://jdstiles.com/index3.html");
  89.  
  90.  
  91. var temp1=document.isc.stage3
  92. function redirect1(y){
  93. for (m=temp1.options.length-1;m>0;m--)
  94. temp1.options[m]=null
  95. for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
  96. temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text, secondGroup[document.isc.example.options.selectedIndex][y][i].value)
  97. }
  98. temp1.options[0].selected=true
  99. }
  100.  
  101. function redirect2(z){
  102. window.location=temp1[z].value
  103. }
[HTML]
//--></script>
</td></tr></table></FORM></center>

</body>[/HTML]
Jun 19 '07 #1
1 2323
acoder
16,027 Recognized Expert Moderator MVP
You just need to change the redirect2 function to display by e.g. elem.innerHTML = whatever, instead of setting window.location .
Jan 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4769
by: Simon Bunker | last post by:
I was just wondering why python doesn't make a distinction between single and double quotes - a bit like Perl does. Obviously I realise there are no dollar signs so you can't intrpolate a varaible in a string. This is fine, but having to remember to put an r in front of regex's is really annoying and it would be great if you could jsut use single quotes instead to interpolate slashes properly etc. (ie only escape them once).
3
5634
by: Danny Woolston | last post by:
Hi I have a double that i want to round to a certain number of decimal places this is the code i use Return Math.Round(mdNumber, mbDecimalPlaces) mbDecimalPlaces is the number of decimal places that i want, but it doesn't use them with two decimal places i still get 0.0 or 9.9
17
12866
by: Suzanne Vogel | last post by:
I'd like to convert a double to a binary representation. I can use the "&" bit operation with a bit mask to convert *non* float types to binary representations, but I can't use "&" on doubles. To get around this limitation on double, I'd like to keep the bits of the double the *same* but change its interpretation to long. I can use "&" on longs. I tried to use reinterpret_cast for this purpose, but it returned zero every time. double...
1
4433
by: Dalan | last post by:
I probably just need a simple piece of code to do this as the couple tried so far have failed. I created a new Access 97 Form Filter (frmFilterForm) which displays most of the key data fields from the main form (frmMain) records. What I'm trying to do is simply double click on an autonumber ID column record in frmFilterForm and have it to open the related record in frmMain for updates. Any assistance will be appreciated. Thanks.
22
3012
by: Fred Ma | last post by:
I'm using the expression "int a = ceil( SomeDouble )". The man page says that ceil returns the smallest integer that is not less than SomeDouble, represented as a double. However, my understanding is that a double has nonuniform precision throughout its value range. Will a double always be able to exactly represent any value of type int? Could someone please point me to an explanation of how this is ensured, given that the details of...
1
2655
by: Alex K. | last post by:
I am using combo box with DropDownStyle = simple. Tried to use double click event but it does not work. I've got this.comboItems.DoubleClick += new System.EventHandler(this.comboItems_DoubleClick); .... private void comboItems_DoubleClick(object sender, System.EventArgs e) {
16
11288
by: Martin Jĝrgensen | last post by:
Hi, Short question: Any particular reason for why I'm getting a warning here: (cast from function call of type int to non-matching type double) xdouble = (double)rand()/(double)RAND_MAX;
9
8059
by: Armando | last post by:
I have an app (A2000) where I am letting the user move an object on the screen. I use the OnClick for a command button event to modify the object's Top (or Left) properties, but you can only click slowly. That is, every other click is ignored, because Access is seeing a double click event. I would put the same code there, except I'm also using the SHIFT key (during mouse click) to cause bigger moves, and there's no SHIFT flag for the...
42
5348
by: xdevel | last post by:
Hi, if I have: int a=100, b = 200, c = 300; int *a = {&a, &b, &c}; than say that: int **b is equal to int *a is correct????
3
5950
by: ssoffline | last post by:
hi i have an app in which i can drop objects onto a form and move them, it consists of graphics (lines), i am using double buffering to avoid filckering in the parent control which is a panel,but when i add controls to this panel dyanamically, the double buffering effect is not there, i move all lines connceted to a control when the control is moved , at this time flickering occurs,also when i enable double buffering for a child control...
0
9529
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.