473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Double drop-down boxes display problem

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="redirect(this.options.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="redirect1(this.options.selectedIndex)">
<option value=" " selected>Dokclines lenghts </option>
</select>

<select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">
<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 2297
acoder
16,027 Expert Mod 8TB
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
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...
3
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...
17
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. ...
1
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...
22
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...
1
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...
16
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
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...
42
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.