473,473 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

controlling options in a drop down box

1 New Member
Hi all,

I'm a newbie to the forum and a Javascript beginner, I'd appreciate some help with a drop down box issue. Is it possble to limit the options/attributes in a drop down box based on how the attribute was rated in a previous question.

Basically, if a customer gives a rating of 'Very Satisfied' or 'Somewhat Satisfied' (values 1 and 2, respectively) to an attribute, that attribute is removed from the list of options in a dropdown box that asks for the 'Area of greatest dissatisfaction'.

My example only gives three attiributes (variables) but the actual case will have 28 attributes. I apologize if the formatting looks messy, my current level of javascript programming is pretty low.

Thanks in advance for any help.

BB


I hope I post this correctly, here is what I currently have:


Expand|Select|Wrap|Line Numbers
  1.  
  2. <HTML><HEAD>
  3.  
  4. </HEAD>
  5. <font face="Verdana" size="1">
  6.  
  7. </font>
  8. <font face="Verdana"><font size="1">
  9.  
  10.  
  11. </font>
  12. <div align="center">
  13.  
  14. <table border="0" width="92%" cellspacing="1" cellpadding="0" height="20">
  15.  
  16. <TR ALIGN=CENTER><TH width="859" height="50" valign="center" colspan="6">
  17.     <p align="left" style="margin-top: 0; margin-bottom: 4px">
  18. Overall, <span style="font-weight: 400">
  19. <font face="Verdana">how satisfied are you with EACH of the following areas?</font><font size="2" face="Verdana"><i>)</i></font></span></TH>
  20. </TR>
  21.  
  22. <TR ALIGN=CENTER><TH width="450" height="45" valign="bottom">
  23.     <p align="left" style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  24.     &nbsp;</TH>
  25.     <TH bgcolor="#008000" height="45" width="104">
  26.       <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  27.         <font face="Verdana" size="1" color="#F2F2F2">Very</font></p>
  28.       <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  29.         <font face="Verdana" size="1" color="#F2F2F2">Satisfied</font></p>
  30.   </TH>
  31. <TH bgcolor="#008000" height="45" width="76">
  32.   <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  33. <font face="Verdana" size="1" color="#F2F2F2">Somewhat</font></p>
  34.   <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  35. <font face="Verdana" size="1" color="#F2F2F2">Satisfied</font></p>
  36.   </TH>
  37. <TH bgcolor="#008000" height="45" width="76">
  38.   <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  39. <font face="Verdana" size="1" color="#F2F2F2">Neither Satisfied Nor Dissatisfied</font></p>
  40.   </TH>
  41. <TH bgcolor="#008000" height="45" width="76">
  42.   <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  43. <font face="Verdana" size="1" color="#F2F2F2">Somewhat Dissatisfied</font></p>
  44.   </TH>
  45. <TH bgcolor="#008000" height="45" width="77">
  46.   <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  47. <font face="Verdana" size="1" color="#F2F2F2">Very Dissatisfied</FONT></font></p>
  48. </TH>
  49. </TR>
  50. <TR ALIGN=CENTER><TD ALIGN=LEFT width="450" bgcolor="#F2F2F2" height="39">
  51.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  52.     <font face="Verdana" size="2" color="#000000">1. Car performance</font></p>
  53.   </TD><td width="104" bgcolor="#F2F2F2" height="39">
  54.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  55.     <font face="Verdana" size="1"><input type="radio" name="Q1_1" value="1"></font></p>
  56.   </td>
  57.     <td width="76" bgcolor="#F2F2F2" height="39">
  58.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  59.     <font face="Verdana" size="1"><input type="radio" name="Q1_1" value="2"></font></p>
  60.   </td>
  61.     <td width="76" bgcolor="#F2F2F2" height="39">
  62.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  63.     <font face="Verdana" size="1"><input type="radio" name="Q1_1" value="3"></font></p>
  64.   </td>
  65.     <td width="76" bgcolor="#F2F2F2" height="39">
  66.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  67.     <font face="Verdana" size="1"><input type="radio" name="Q1_1" value="4"></font></p>
  68.   </td><td width="77" bgcolor="#F2F2F2" height="39">
  69.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  70.     <font face="Verdana" size="1"><input type="radio" name="Q1_1" value="5"></font></p>
  71.   </td></TR>
  72. <TR ALIGN=CENTER><TD ALIGN=LEFT width="450" height="34">
  73.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  74.     <font face="Verdana" size="2" color="#000000">2. Car reliability</font></p>
  75.   </TD>
  76.     <td width="104" height="34">
  77.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  78.     <font face="Verdana" size="1"><input type="radio" name="Q1_2" value="1"></font></p>
  79.   </td>
  80.     <td width="76" height="34">
  81.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  82.     <font face="Verdana" size="1"><input type="radio" name="Q1_2" value="2"></font></p>
  83.   </td>
  84.     <td width="76" height="34">
  85.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  86.     <font face="Verdana" size="1"><input type="radio" name="Q1_2" value="3"></font></p>
  87.   </td>
  88.     <td width="76" height="34">
  89.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  90.     <font face="Verdana" size="1"><input type="radio" name="Q1_2" value="4"></font></p>
  91.   </td><td width="77" height="34">
  92.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  93.     <font face="Verdana" size="1"><input type="radio" name="Q1_2" value="5"></font></p>
  94.   </td></TR>
  95. <TR ALIGN=CENTER><TD ALIGN=LEFT width="450" bgcolor="#F2F2F2" height="34">
  96.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  97.     <font face="Verdana" size="2" color="#000000">3. Gas mileage</font></p>
  98.   </TD>
  99.     <td width="104" bgcolor="#F2F2F2" height="34">
  100.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  101.     <font face="Verdana" size="1"><input type="radio" name="Q1_3" value="1"></font></p>
  102.   </td>
  103.     <td width="76" bgcolor="#F2F2F2" height="34">
  104.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  105.     <font face="Verdana" size="1"><input type="radio" name="Q1_3" value="2"></font></p>
  106.   </td>
  107.     <td width="76" bgcolor="#F2F2F2" height="34">
  108.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  109.     <font face="Verdana" size="1"><input type="radio" name="Q1_3" value="3"></font></p>
  110.   </td>
  111.     <td width="76" bgcolor="#F2F2F2" height="34">
  112.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  113.     <font face="Verdana" size="1"><input type="radio" name="Q1_3" value="4"></font></p>
  114.   </td><td width="77" bgcolor="#F2F2F2" height="34">
  115.     <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  116.     <font face="Verdana" size="1"><input type="radio" name="Q1_3" value="5"></font></p>
  117.   </td></TR>
  118. <TR ALIGN=CENTER><TD ALIGN=LEFT width="859" height="50" colspan="6">
  119. <font face="Verdana">
  120.   </TD>
  121.     </TR>
  122. </TABLE>
  123.     <font face="Verdana">
  124. </font>
  125. <table border="0" cellspacing="1" width="92%" cellpadding="0">
  126.   <tr>
  127.       <td width="726" height="26">
  128. <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  129. <font face="Verdana" color="#008000" size="2">With which <b>ONE</b>, if any, of these areas are you 
  130. <b>THE MOST dissatisfied</b>?</font></td>
  131.     </tr>
  132.   <tr>
  133.     <td width="99%" bgcolor="#F2F2F2">
  134.       <font face="Verdana">
  135.       <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0"><font size="1" face="Verdana">
  136. <SELECT NAME="Q2"; size="1">
  137. <OPTION selected value="">(Click here to choose)
  138. <OPTION value="1"> 1  Car performance
  139. <OPTION value="2"> 2  Car reliability
  140. <OPTION value="3"> 3  Gas mileage
  141. </SELECT>
  142. </font>
  143.       </p>
  144.     </td>
  145.   </tr>
  146.   <tr>
  147.     <td width="99%" height="20">
  148.       <p style="word-spacing: 0; line-height: 100%; text-indent: 0; margin: 0">
  149. <font face="Verdana">
  150.       </td>
  151.     <td>
  152.     </td>
  153.   </tr>
  154. </table>
  155. </BLOCKQUOTE>
  156.  
  157. </FORM>
  158.  
  159. </font>
  160. </BODY>
  161. </HTML>
  162.  
  163.  
Oct 10 '07 #1
1 1876
acoder
16,027 Recognized Expert Moderator MVP
You could loop through all the questions from 1 to 28. Use document.getElementsByName("Q1_"+num) to get the radio buttons for each question where num is the current question.

Then check the checked property of each radio button to find out which option has been checked. If it's 1 or 2, we can mark it for deletion from the dropdown list.

To see how to remove options from a dropdown list, see this link.
Nov 3 '07 #2

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

Similar topics

3
by: Darren | last post by:
Please Help Me!! I've created a typical <form> and a <select> element. The options are created dynamically from my access database (using asp). There are about 70 options, and when you click...
1
by: sleon | last post by:
I have two drop down list boxes, category, and subcategory. The subcategory list does not get populated until a selection has been made from the "category" list. When a selection is made from...
3
by: Ben | last post by:
I have two drop down box's in a form, how would I go about changing the options of the seccond one depending on what option is selected in the first one? For example, if there's a drop down box...
1
by: joshb | last post by:
Hey guys, I'm in the last steps of my project, just a small question here. What I'm doing right now is using an iframe to populate my drop-down listboxes and have them display dynamic...
3
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I am have a drop down list, whose options are read in dynamically from a table in a MySQL database. one of the items being read in is an URL. I am unable to...
4
by: teknoshock | last post by:
I have created a page with multiple drop down boxes, all populated with the same options. My problem is, for 12 dropdown boxes and 40 choices per box, I end up with a massive file. Also, if I...
1
by: mcapacci | last post by:
I would like to force the flow of the scrolling of the options listed in a drop down menu, <select>, from top to bottom without allowing bottom up scroll to appear; furthermore I need also to...
6
by: azegurb | last post by:
Hello, I have one question again i created one table again and in this table i added some another options for ex at the previous table there were only one problem sum of the dynamically added...
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
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...
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.