473,889 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to validate drop list as long user select from one of the list options

29 New Member
i have 3 drop down lists as long the user selects one of the option from one of the drop downs pass validation but if users don't select an option from at least one of the drop down fail validation.

Expand|Select|Wrap|Line Numbers
  1.  <?php
  2. // Create an empty array to hold the error messages.
  3. $arrErrors = array();
  4. //Only validate if the Submit button was clicked.
  5. if (!empty($_POST['Submit'])) {
  6.     // Each time there's an error, add an error message to the error array
  7.     // using the field name as the key.
  8.  
  9.         if ($_POST['campustype']=='')
  10.         $arrErrors['campustype'] = 'Please select category.';
  11.  
  12.         if ($_POST['howt']=='')
  13.         $arrErrors['howt'] = 'select one field.';
  14.  
  15.     if (count($arrErrors) == 0) {
  16.         // If the error array is empty, there were no errors.
  17.         // Insert form processing here.
  18.     } else {
  19.         // The error array had something in it. There was an error.
  20.         // Start adding error text to an error string.
  21.         $strError = '<div class="formerror"><p><img src="/images/triangle_error.gif" width="16" height="16" hspace="5" alt="">Please check the following and try again:</p><ul>';
  22.         // Get each error and add it to the error string
  23.         // as a list item.
  24.         foreach ($arrErrors as $error) {
  25.             $strError .= "<li>$error</li>";
  26.         }
  27.         $strError .= '</ul></div>';
  28.     }
  29. }
  30. ?>
  31.  
  32. <style>
  33. .formerror {
  34.   border: 1px solid red;
  35.   background-color : #FFCCCC;
  36.   width: auto;
  37.   padding: 5px 0;
  38. }
  39.  
  40. .errortext {
  41.   padding-left: 80px;
  42.   font-size:14px;
  43.   color:red;
  44.  
  45. }
  46. </style>
  47.  
  48. <script type="text/javascript">
  49. function toggleSelect(id)
  50. {
  51.     if (id == 'off')
  52.     {
  53.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  54.           document.getElementById('1').style['display'] = 'none';
  55.           document.getElementById('off-campus').style['display'] = 'block';
  56.     }
  57.  
  58.     if (id == 'in')
  59.     {
  60.           document.getElementById('off-campus').style['display'] = 'none';
  61.           document.getElementById('1').style['display'] = 'none';
  62.           document.getElementById('in-campu').style['display'] = 'block';//ui
  63.     }
  64.  
  65. if (id == '1')
  66.     {
  67.           document.getElementById('off-campus').style['display'] = 'none';
  68.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  69.           document.getElementById('1').style['display'] = 'block';
  70.     }
  71. }
  72. </script>
  73.  
  74. <?php echo $strError; ?>
  75. <form method="post" action="<?php echo $PHP_SELF; ?>">
  76. <!--
  77. For every form field, we do the following...
  78.  
  79. Check to see if there's an error message for this form field. If there is,
  80. add the formerror class to the surrounding paragraph block. The formerror
  81. class contains the highlighted box.
  82.  
  83. Insert the contents of what the user submitted bak into the form field.
  84.  
  85. Check again to see if this field has an error message. If it does, show
  86. the error icon and the error message next to the field.
  87. -->
  88.  
  89. <p<?php if (!empty($arrErrors['campustype'])) echo ' class="formerro"'; ?>>
  90.  
  91.     <?php if (!empty($arrErrors['campustype'])) echo '<br /><span class="errortext">'.$arrErrors['campustype'].'</span>'; ?><br/><label for="incampus">Select Category</label>
  92. <input type="radio" name="campustype" value="in" onclick="toggleSelect('in');" /><label for="campustype">Music</label>
  93.  
  94. <input type="radio" name="campustype" value="off'" onclick="toggleSelect('off');" /><label for="campustype">Sports</label>
  95.  
  96. <input type="radio" name="campustype" value="1" onclick="toggleSelect('1');" /><label for="campustype">Art</label>
  97.  
  98. </p>
  99.  
  100. <p<?php if (!empty($arrErrors['howt'])) echo ' class="formerro"'; ?>>
  101.  
  102.     <?php if (!empty($arrErrors['howt'])) echo '<br /><span class="errortext">'.$arrErrors['howt'].'</span>'; ?><br/>
  103.  
  104. <select id="in-campu" name="howt">
  105.  <option name="hot"  value ="">--Select  Music Type--</option>
  106. <option name="how" value="tuiy">Concerts</option>
  107. <option name="hot" value="tfyrty" >Clubs</option>
  108. <option name="hot" value="rtyyt">Festival</option>
  109. <option name="hot" value="uyity">Opera</option>
  110. </select>
  111.  
  112.     <select id="off-campus" class="item" name="hot" style="display: none;">
  113.  <option name="dg" value=""> -- Select Sport Type -- </option>
  114. <option name="hot" value="dfg">Formula 1</option>
  115. <option name="hot" value="dfrg">Footbal</option>
  116. <option name="hot" value="dfgf">Basketball</option>
  117. <option name="how" value="rugby">Rugby</option>
  118. <option name="hot" value="cricket">Cricket</option>
  119. </select>
  120.  
  121.     <select id="1" class="item" name="ho" style="display: none;">
  122. <option name="hot" value=""> -- Select Art & Theatre Type -- </option>
  123. <option name="ht" value="hjk">Comedy</option>
  124. <option name="ho"  value=" gfhftgh">Drama</option>
  125. <option name="hghjot" value="ioiui">Museus</option>
  126. </select>
  127.  
  128. </p>
  129. <p>
  130.     <input type="submit" name="Submit" value="Submit">
  131. </p>
  132. </form>   
Apr 13 '10 #1
5 2245
rahuljaiswal1987
23 New Member
Its very tuff to understand why you want to VALIDATE drop down boxes as its the gun treatment for end user for not doing invalid things.
Apr 13 '10 #2
NettSIte
7 New Member
You are not providing enough information: do you want to do a validation at the server to check that a value has been selected from at least select?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if (empty($_REQUEST['select1']) && empty($_REQUEST['select2']) ) {
  3.   echo "You have to select something somewhere!"; // do error stuff
  4. }
  5. ?>
Apr 13 '10 #3
lisa007
29 New Member
nobody seems to understand my question a picture speaks a thousand words please here's the whole code can u guys run please and you notice that drop list doesnt get validate even if the user select one option reason is there's actually 3 drop list depending on which radio the user select so if user select music a music drop down list will be on dipslay all the other will be kept hideen but unfortunally to pass the validation the user has to click each radio one by one and each time slect from their respective drop down please run the whole code for better understand help please

Expand|Select|Wrap|Line Numbers
  1.  <?php
  2. // Create an empty array to hold the error messages.
  3. $arrErrors = array();
  4. //Only validate if the Submit button was clicked.
  5. if (!empty($_POST['Submit'])) {
  6.     // Each time there's an error, add an error message to the error array
  7.     // using the field name as the key.
  8.     if ($_POST['name']=='')
  9.         $arrErrors['name'] = 'Please provide your name.';
  10.     if ($_POST['email']=='')
  11.         $arrErrors['email'] = 'A valid email address is required.';
  12.     if ($_POST['phone']=='')
  13.         $arrErrors['phone'] = 'Please provide your phone number.';
  14.  
  15.         if ($_POST['campustype']=='')
  16.         $arrErrors['campustype'] = 'Please select category.';
  17.  
  18.         if ($_POST['howt']=='')
  19.         $arrErrors['howt'] = 'select one field.';
  20.  
  21.     if (count($arrErrors) == 0) {
  22.         // If the error array is empty, there were no errors.
  23.         // Insert form processing here.
  24.     } else {
  25.         // The error array had something in it. There was an error.
  26.         // Start adding error text to an error string.
  27.         $strError = '<div class="formerror"><p><img src="/images/triangle_error.gif" width="16" height="16" hspace="5" alt="">Please check the following and try again:</p><ul>';
  28.         // Get each error and add it to the error string
  29.         // as a list item.
  30.         foreach ($arrErrors as $error) {
  31.             $strError .= "<li>$error</li>";
  32.         }
  33.         $strError .= '</ul></div>';
  34.     }
  35. }
  36. ?>
  37.  
  38. <style>
  39. .formerror {
  40.   border: 1px solid red;
  41.   background-color : #FFCCCC;
  42.   width: auto;
  43.   padding: 5px 0;
  44. }
  45.  
  46. .errortext {
  47.   padding-left: 80px;
  48.   font-size:14px;
  49.   color:red;
  50. }
  51. </style>
  52.  
  53. <script type="text/javascript">
  54. function toggleSelect(id)
  55. {
  56.     if (id == 'off')
  57.     {
  58.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  59.           document.getElementById('1').style['display'] = 'none';
  60.           document.getElementById('off-campus').style['display'] = 'block';
  61.     }
  62.  
  63.     if (id == 'in')
  64.     {
  65.           document.getElementById('off-campus').style['display'] = 'none';
  66.           document.getElementById('1').style['display'] = 'none';
  67.           document.getElementById('in-campu').style['display'] = 'block';//ui
  68.     }
  69.  
  70. if (id == '1')
  71.     {
  72.           document.getElementById('off-campus').style['display'] = 'none';
  73.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  74.           document.getElementById('1').style['display'] = 'block';
  75.     }
  76. }
  77. </script>
  78.  
  79. <?php echo $strError; ?>
  80. <form method="post" action="<?php echo $PHP_SELF; ?>">
  81. <!--
  82. For every form field, we do the following...
  83.  
  84. Check to see if there's an error message for this form field. If there is,
  85. add the formerror class to the surrounding paragraph block. The formerror
  86. class contains the highlighted box.
  87.  
  88. Insert the contents of what the user submitted bak into the form field.
  89.  
  90. Check again to see if this field has an error message. If it does, show
  91. the error icon and the error message next to the field.
  92. -->
  93. <p<?php if (!empty($arrErrors['name'])) echo ' class="formerro"'; ?>>
  94.  
  95.     <?php if (!empty($arrErrors['name'])) echo '<br /><span class="errortext">'.$arrErrors['name'].'</span>'; ?>
  96. <br />
  97.     <label for="name">Name:</label>
  98.     <input name="name" type="text" id="name" value="<?php echo $_POST['name'] ?>">
  99. </p>
  100.  
  101. <p<?php if (!empty($arrErrors['campustype'])) echo ' class="formerro"'; ?>>
  102.  
  103.     <?php if (!empty($arrErrors['campustype'])) echo '<br /><span class="errortext">'.$arrErrors['campustype'].'</span>'; ?><br/><label for="incampus">Select Category</label>
  104. <input type="radio" name="campustype" value="in" onclick="toggleSelect('in');" /><label for="campustype">Music</label>
  105.  
  106. <input type="radio" name="campustype" value="off'" onclick="toggleSelect('off');" /><label for="campustype">Sports</label>
  107.  
  108. <input type="radio" name="campustype" value="1" onclick="toggleSelect('1');" /><label for="campustype">Art</label>
  109.  
  110. </p>
  111.  
  112. <p<?php if (!empty($arrErrors['howt'])) echo ' class="formerro"'; ?>>
  113.  
  114.     <?php if (!empty($arrErrors['howt'])) echo '<br /><span class="errortext">'.$arrErrors['howt'].'</span>'; ?><br/>
  115.  
  116. <select id="in-campu" name="howt">
  117.  <option name="hot"  value ="">--Select  Music Type--</option>
  118. <option name="how" value="tuiy">Concerts</option>
  119. <option name="hot" value="tfyrty" >Clubs</option>
  120. <option name="hot" value="rtyyt">Festival</option>
  121. <option name="hot" value="uyity">Opera</option>
  122. </select>
  123.  
  124.     <select id="off-campus" class="item" name="hot" style="display: none;">
  125.  <option name="dg" value=""> -- Select Sport Type -- </option>
  126. <option name="hot" value="dfg">Formula 1</option>
  127. <option name="hot" value="dfrg">Footbal</option>
  128. <option name="hot" value="dfgf">Basketball</option>
  129. <option name="how" value="rugby">Rugby</option>
  130. <option name="hot" value="cricket">Cricket</option>
  131. </select>
  132.  
  133.     <select id="1" class="item" name="ho" style="display: none;">
  134. <option name="hot" value=""> -- Select Art & Theatre Type -- </option>
  135. <option name="ht" value="hjk">Comedy</option>
  136. <option name="ho"  value=" gfhftgh">Drama</option>
  137. <option name="hghjot" value="ioiui">Museus</option>
  138. </select>
  139.  
  140. </p>
  141.  
  142. <p<?php if (!empty($arrErrors['email'])) echo ' class="formerro"'; ?>>
  143.  
  144.     <?php if (!empty($arrErrors['email'])) echo '<br /><span class="errortext">'.$arrErrors['email'].'</span>'; ?>
  145. <br />
  146.     <label for="email">Email:</label>
  147.     <input name="email" type="text" id="email" value="<?php echo $_POST['email'] ?>">
  148. </p>
  149.  
  150. <p<?php if (!empty($arrErrors['phone'])) echo ' class="formerro"'; ?>>
  151.  
  152.     <?php if (!empty($arrErrors['phone'])) echo '<br /><span class="errortext">'.$arrErrors['phone'].'</span>'; ?>
  153. <br />
  154.     <label for="phone">Phone:</label>
  155.     <input name="phone" type="text" id="phone" value="<?php echo $_POST['phone'] ?>">
  156. </p>
  157.  
  158. <p>
  159.     <input type="submit" name="Submit" value="Submit">
  160. </p>
  161. </form>   
Apr 13 '10 #4
NettSIte
7 New Member
Hi Lisa,

Expand|Select|Wrap|Line Numbers
  1. if ($_POST['campustype']=='') { 
  2.             $arrErrors['campustype'] = 'Please select category.'; 
  3.         }
  4.         else {
  5.             switch ($_POST['campustype']) {
  6.                 case "in":
  7.                     if ($_POST['howt']=='') $arrErrors['howt'] = 'select one field.';
  8.                     break;
  9.                 case "out":
  10.                     if ($_POST['hot']=='') $arrErrors['hot'] = 'select one field.';
  11.                     break;
  12.                 case "1":
  13.                     if ($_POST['ho']=='') $arrErrors['ho'] = 'select one field.';
  14.                     break;
  15.             }
Should work.
Apr 13 '10 #5
lisa007
29 New Member
@NettSIte
almost did work but one problem

<?php if (!empty($arrErr ors['campustype'])) echo '<br /><span class="errortex t">'.$arrErr ors['campustype'].'</span>'; ?>

which this call the error campustype so as long the user select one radio it pass the validation without the user even have to select from the drop down list how can i get that line to display error depending on the 3 drop downs not the radio i've added 2 comments named (newbie) thats one with your new code and the other where the problems is on line 151 and 153 cz that call for the error which is campustype i tried.. call for error howt or how or ho.. still didnt work

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. // Create an empty array to hold the error messages.
  4. $arrErrors = array();
  5. //Only validate if the Submit button was clicked.
  6. if (!empty($_POST['Submit'])) {
  7.     // Each time there's an error, add an error message to the error array
  8.     // using the field name as the key.
  9.     if ($_POST['name']=='')
  10.         $arrErrors['name'] = 'Please provide your name.';
  11.     if ($_POST['email']=='')
  12.         $arrErrors['email'] = 'A valid email address is required.';
  13.     if ($_POST['phone']=='')
  14.         $arrErrors['phone'] = 'Please provide your phone number.';
  15.  
  16.         // Newbie your code starts here
  17.         if ($_POST['campustype']=='')
  18.         $arrErrors['campustype'] = 'Please select category.';
  19.  
  20.         }
  21.         else {
  22.             switch ($_POST['campustype']) {
  23.                 case "in":
  24.                     if ($_POST['howt']=='') $arrErrors['howt'] = 'select one field.';
  25.                     break;
  26.                 case "in":
  27.                     if ($_POST['hot']=='') $arrErrors['hot'] = 'select one field.';
  28.                     break;
  29.                 case "1":
  30.                     if ($_POST['ho']=='') $arrErrors['ho'] = 'select one field.';
  31.                     break;
  32.             }
  33.  // Newbie your  code ends here
  34.  
  35.     if (count($arrErrors) == 0) {
  36.         // If the error array is empty, there were no errors.
  37.         // Insert form processing here.
  38.     } else {
  39.         // The error array had something in it. There was an error.
  40.         // Start adding error text to an error string.
  41.         $strError = '<div class="formerror"><p><img src="/images/triangle_error.gif" width="16" height="16" hspace="5" alt="">Please check the following and try again:</p><ul>';
  42.         // Get each error and add it to the error string
  43.         // as a list item.
  44.         foreach ($arrErrors as $error) {
  45.             $strError .= "<li>$error</li>";
  46.         }
  47.         $strError .= '</ul></div>';
  48.     }
  49. }
  50. ?>
  51.  
  52. <style>
  53. .formerror {
  54.   border: 1px solid red;
  55.   background-color : #FFCCCC;
  56.   width: auto;
  57.   padding: 5px 0;
  58. }
  59.  
  60. .errortext {
  61.   padding-left: 80px;
  62.   font-size:14px;
  63.   color:red;
  64. }
  65. </style>
  66.  
  67. <script type="text/javascript">
  68. function toggleSelect(id)
  69. {
  70.     if (id == 'off')
  71.     {
  72.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  73.           document.getElementById('1').style['display'] = 'none';
  74.           document.getElementById('off-campus').style['display'] = 'block';
  75.     }
  76.  
  77.     if (id == 'in')
  78.     {
  79.           document.getElementById('off-campus').style['display'] = 'none';
  80.           document.getElementById('1').style['display'] = 'none';
  81.           document.getElementById('in-campu').style['display'] = 'block';//ui
  82.     }
  83.  
  84. if (id == '1')
  85.     {
  86.           document.getElementById('off-campus').style['display'] = 'none';
  87.           document.getElementById('in-campu').style['display'] = 'none'; //ui
  88.           document.getElementById('1').style['display'] = 'block';
  89.     }
  90. }
  91. </script>
  92.  
  93. <?php echo $strError; ?>
  94. <form method="post" action="<?php echo $PHP_SELF; ?>">
  95. <!--
  96. For every form field, we do the following...
  97.  
  98. Check to see if there's an error message for this form field. If there is,
  99. add the formerror class to the surrounding paragraph block. The formerror
  100. class contains the highlighted box.
  101.  
  102. Insert the contents of what the user submitted bak into the form field.
  103.  
  104. Check again to see if this field has an error message. If it does, show
  105. the error icon and the error message next to the field.
  106. -->
  107. <p<?php if (!empty($arrErrors['name'])) echo ' class="formerro"'; ?>>
  108.  
  109.     <?php if (!empty($arrErrors['name'])) echo '<br /><span class="errortext">'.$arrErrors['name'].'</span>'; ?>
  110. <br />
  111.     <label for="name">Name:</label>
  112.     <input name="name" type="text" id="name" value="<?php echo $_POST['name'] ?>">
  113. </p>
  114.  
  115. <p<?php if (!empty($arrErrors['campustype'])) echo ' class="formerro"'; ?>>
  116.  
  117.     <?php if (!empty($arrErrors['campustype'])) echo '<br /><span class="errortext">'.$arrErrors['campustype'].'</span>'; ?><br/><label for="incampus">Select Category</label>
  118. <input type="radio" name="campustype" value="in" onclick="toggleSelect('in');" /><label for="campustype">Music</label>
  119.  
  120. <input type="radio" name="campustype" value="off'" onclick="toggleSelect('off');" /><label for="campustype">off</label>
  121.  
  122. <input type="radio" name="campustype" value="1" onclick="toggleSelect('1');" /><label for="campustype">1</label>
  123.  
  124. </p>
  125.  
  126. <?php //  Newbie  this calls only the campus error i want to call the how,hot, and ho if one of them not selected ?>
  127.  
  128. <p<?php if (!empty($arrErrors['campustype'])) echo ' class="formerro"'; ?>>
  129.  
  130.     <?php if (!empty($arrErrors['campustype'])) echo '<br /><span class="errortext">'.$arrErrors['campustype'].'</span>'; ?><br/>
  131.  
  132. <select id="in-campu" name="howt">
  133.  <option   value ="">--Select  Music Type--</option>
  134. <option  value="tuiy">Concerts</option>
  135. <option  value="tfyrty" >Clubs</option>
  136. <option  value="rtyyt">Festival</option>
  137. <option  value="uyity">Opera</option>
  138. </select>
  139.  
  140.     <select id="off-campus" class="item" name="hot" style="display: none;">
  141.  <option name="" value=""> -- Select Sport Type -- </option>
  142. <option  value="dfg">Formula 1</option>
  143. <option  value="dfrg">Footbal</option>
  144. <option  value="dfgf">Basketball</option>
  145. <option  value="rugby">Rugby</option>
  146. <option  value="cricket">Cricket</option>
  147. </select>
  148.  
  149.     <select id="1" class="item" name="ho" style="display: none;">
  150. <option name="" value=""> -- Select Art & Theatre Type -- </option>
  151. <option  value="hjk">Comedy</option>
  152. <option   value=" gfhftgh">Drama</option>
  153. <option  value="ioiui">Museus</option>
  154. </select>
  155. </p>
  156.  
  157. <p<?php if (!empty($arrErrors['email'])) echo ' class="formerro"'; ?>>
  158.  
  159.     <?php if (!empty($arrErrors['email'])) echo '<br /><span class="errortext">'.$arrErrors['email'].'</span>'; ?>
  160. <br />
  161.     <label for="email">Email:</label>
  162.     <input name="email" type="text" id="email" value="<?php echo $_POST['email'] ?>">
  163. </p>
  164.  
  165. <p<?php if (!empty($arrErrors['phone'])) echo ' class="formerro"'; ?>>
  166.  
  167.     <?php if (!empty($arrErrors['phone'])) echo '<br /><span class="errortext">'.$arrErrors['phone'].'</span>'; ?>
  168. <br />
  169.     <label for="phone">Phone:</label>
  170.     <input name="phone" type="text" id="phone" value="<?php echo $_POST['phone'] ?>">
  171. </p>
  172.  
  173. <p>
  174.     <input type="submit" name="Submit" value="Submit">
  175. </p>
  176. </form> 
Apr 13 '10 #6

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

Similar topics

2
11073
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic SFSB and, from there, to the database. On the front end, all cells appear as text fields. However, for certain cells, when the user clicks on the cell, the text field turns into a drop-down field (i.e. Select object), defaulting to the value...
6
9331
by: Filiz Duman | last post by:
I was just wondering, is it possible to write into the drop down box in order to jump to a specific item. The reason why I am asking is my drop down box has many items and additionally to the scrolling down, it would be good if the user can write into the box in order to get the specific entry the list selected. Is this possible ? Thanks.
3
23340
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 the dropdown button, it shows about 25 (depending on screen resolution) and then the gives you a scroll bar to get to the rest. My question is, can I limit the number of options shown when you click
3
3213
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to navigate to the desired option quickly just by typing out the name. For example if I want to choose "Other" (All the options are arranged alhabetically within the Drop-down box) from Drop-down and if I Type "O" then I navigate to first entry with...
3
1259
by: rashni | last post by:
Hi, I have a select list (drop down list) it has very long names like... ababababababbabbabbababababbabbabbabaabbbaabbababba so by using style="width:100px" I have cut the size like this- <select name="cars" style="width:100px" But when user tries to access ths list I want the user to be able to read the whole name. So when user clicks on this select list I want to replace it with the actual size.
3
3000
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in the drop down box to go back to what the value was before the user tried to change it, but at that point I will not know what the original value was. Or is there a drop down control "revert" method, or is there any way of knowing what the original...
4
9829
by: tjonsek | last post by:
I have two drop down boxes on a form. One feeds the second a list options based on user selection. With the second drop down, I want code that displays dynamic text in a <div> based on whatever the user selects. So far, it doesn't seem to be firing. I am only testing the functionality because I have quite a bit of text to display depending on the users input and want to get it working first before I bother typing everything.
4
2286
by: Ian Richardson | last post by:
Hi, The function I've put together below is a rough idea to extend a SELECT list, starting from: <body> <form name="bambam"> <select id="fred"> <option value="1">1</option> <option value="2">2</option>
1
5961
by: abTech | last post by:
Have struggled a lot to get a filtered drop down in the normal html and that too editable ... i have used table like auto-completion etc ... This is the simplest solution for a filtered drop down <SELECT NAME="drop" id='drop' onkeyup="editOption(arguments, this)" style='width:100px;cursor:text' mode="1"> <option value="0">Default</option> … </SELECT> Mode 0: Filters the list till a valid match is found, if not found then will behave...
8
1568
by: pgt | last post by:
I have a working couple of pages (form submits 2 variables to the second page using GET). page1 has two dropdowns (generated from MySQL db). page2 retrieves info from the database accordingly, depending on the passed variables. Works fine. I need to ensure that the user has actually selected both variables on page1
0
9961
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9803
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
10783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10439
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...
0
9598
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7148
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
6021
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
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 we have to send another system
3
3252
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.