Problems capturing data from drop down menus using FORM tags

  • darqbluwulf
  • Born
  • Born
  • darqbluwulf
  • Posts: 4

Post 3+ Months Ago

I have the following code:

Code: [ Select ]
<form>


 <table>
  <tr>



  <td>
   <table>
   <tr>
    <td>
    DECLARATION FOR DROP DOWN MENU 1
    </td> 
   </tr>

   <tr> 
    <td>
     DECLARATION FOR DROP DOWN MENU 2
    </td> 
   </tr>
   .
   .
   .
   .
   <tr>
    <td>
    DECLARATION FOR DROP DOWN MENU n
    </td> 
   </tr>
   </table> 



  <td> 
  </tr>




  <tr>
  <td>

   <table>
   <tr>
    <td>
    DECLARATION FOR BUTTON 1 GOES HERE
    </td>
   </tr>
 
   <tr>
    <td>
    DECLARATION FOR BUTTON 2 GOES HERE (I need this buton to capture what was selected in the above drop down menu(s))

  <!-- NOTE that this button is now sandwhich between BUTTON 1 and BUTTON 3, and I think thats what is causing the problem. Because when I comment out BUTTON 1, BUTTON 2 now is able to capture the data values in the drop down menus -->
    </td>
   </tr>

   <tr>
    <td>
    DECLARATION FOR BUTTON 3 GOES HERE
    </td>
   </tr>
   .
   .
   .
   <tr>
    <td>
    DECLARATION FOR BUTTON n GOES HERE
    </td>
   </tr>
   </table>


  </td>
  </tr>
 </table>


</form>
  1. <form>
  2.  <table>
  3.   <tr>
  4.   <td>
  5.    <table>
  6.    <tr>
  7.     <td>
  8.     DECLARATION FOR DROP DOWN MENU 1
  9.     </td> 
  10.    </tr>
  11.    <tr> 
  12.     <td>
  13.      DECLARATION FOR DROP DOWN MENU 2
  14.     </td> 
  15.    </tr>
  16.    .
  17.    .
  18.    .
  19.    .
  20.    <tr>
  21.     <td>
  22.     DECLARATION FOR DROP DOWN MENU n
  23.     </td> 
  24.    </tr>
  25.    </table> 
  26.   <td> 
  27.   </tr>
  28.   <tr>
  29.   <td>
  30.    <table>
  31.    <tr>
  32.     <td>
  33.     DECLARATION FOR BUTTON 1 GOES HERE
  34.     </td>
  35.    </tr>
  36.  
  37.    <tr>
  38.     <td>
  39.     DECLARATION FOR BUTTON 2 GOES HERE (I need this buton to capture what was selected in the above drop down menu(s))
  40.   <!-- NOTE that this button is now sandwhich between BUTTON 1 and BUTTON 3, and I think thats what is causing the problem. Because when I comment out BUTTON 1, BUTTON 2 now is able to capture the data values in the drop down menus -->
  41.     </td>
  42.    </tr>
  43.    <tr>
  44.     <td>
  45.     DECLARATION FOR BUTTON 3 GOES HERE
  46.     </td>
  47.    </tr>
  48.    .
  49.    .
  50.    .
  51.    <tr>
  52.     <td>
  53.     DECLARATION FOR BUTTON n GOES HERE
  54.     </td>
  55.    </tr>
  56.    </table>
  57.   </td>
  58.   </tr>
  59.  </table>
  60. </form>



But for some strange reason though BUTTON 2 isn't able to capture the data values of the (above decleared drop down menus)

As you can see BUTTON 2 is sandwhiched between BUTTON 1 and BUTTON 3, and I think thats what is causing the problem. Because when I comment out BUTTON 1 (and put </form> right below the declaration for BUTTON 2), BUTTON 2 is now able to capture the data values in the drop down menus.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

if they're in the same form the values should still work without much hassle
  • darqbluwulf
  • Born
  • Born
  • darqbluwulf
  • Posts: 4

Post 3+ Months Ago

neksus wrote:
if they're in the same form the values should still work without much hassle



The operative word there is should work......unfortunately for me they don't ! :( :( :(
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

The <button> element takes both a starting tag AND an ending tag, with text in between for the content of the button.

You need <button>Click me</button>, not just a starting tag. (Of course, "click me" isn't good textual content; something like "submit the form" or "process" would be more descriptive and make sense for systems that lack mouses, such as PDAs.)

I am guessing that you just used the starting tag.

(edit: Of course, we don't know what is actually the problem, because you haven't provided the actual code. And my crystal ball is currently in for repairs.)
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

i didnt know button was a tag! but hey, i guess i've been using good tags then :D
  • darqbluwulf
  • Born
  • Born
  • darqbluwulf
  • Posts: 4

Post 3+ Months Ago

Sam Hughes wrote:
The <button> element takes both a starting tag AND an ending tag, with text in between for the content of the button.

You need <button>Click me</button>, not just a starting tag. (Of course, "click me" isn't good textual content; something like "submit the form" or "process" would be more descriptive and make sense for systems that lack mouses, such as PDAs.)

I am guessing that you just used the starting tag.

(edit: Of course, we don't know what is actually the problem, because you haven't provided the actual code. And my crystal ball is currently in for repairs.)




This is the code that I have:

Code: [ Select ]
function query_form($node_to_preselect,$user_to_preselect,$day_to_preselect_for_start_range,$month_to_preselect_for_start_range,$year_to_preselect_for_start_range,$hour_to_preselect_for_start_range,$minute_to_preselect_for_start_range,$second_to_preselect_for_start_range,$day_to_preselect_for_end_range,$month_to_preselect_for_end_range,$year_to_preselect_for_end_range,$hour_to_preselect_for_end_range,$minute_to_preselect_for_end_range,$second_to_preselect_for_end_range)

     {


         ?>
         
          
          <table border="1" width="10%">
                                         <form method="post" name="query_form" action="build_query.php">                                        
           <tr>
           <td align="center">
            <table border="1" align="center">
            <tr>
             <th colspan="2">
             <small>
              <acronym title="Select VARIABLES FOR QUERY from the drop down menus below">SELECT VARIABLES FOR QUERY</acronym>
             <small>
             </th>
            </tr>

            <tr>
             <td colspan="2" style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>
             <td colspan="2">
             <table border="1">
              <tr>
              <th align="left">
               <small>
               <acronym title="Select NODE from the drop down menu on your right">NODE</acronym>
               </small>
              </th>


              <td colspan="2">
               <?php
               select_node_drop_down_menu($node_to_preselect="");
               ?>
              </td>


              <td>
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </td>



              <th align="left">
               <small>
               <acronym title="Select USER from the drop down menu on your right">USER</acronym>
               </small>
              </th>

              <td>
               <?php
               select_user_drop_down_menu($user_to_preselect="");
               ?>
              </td>

              </tr>
             </table>
             </td>
            </tr>

            <tr>
             <td colspan="2" style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>
             <th align="center">
             <small style="font-size:13px">
              <acronym title="Select an START RANGE from the drop down menus below">SELECT START RANGE</acronym>
             </small>
             </th>

             <th align="center">
             <small style="font-size:13px">
              <acronym title="Select an END RANGE from the drop down menus below">SELECT END RANGE</acronym>
             </small>
             </th>
            </tr>

            <tr>
             <td colspan="2" style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>

             <td>
              <table border="1" width="10">
              <th align="center">
               <small style="font-size:11px">
               <acronym title="Select SART DATE from the drop down menus on your right">START DATE</acronym>
               </small>
              <th>

               <td>
               <?php
                select_year_drop_down_menu_start_range($year_to_preselect_for_start_range=$year_to_preselect_for_start_range);
               ?>
               </td>

               <td>
               <?php
                select_month_drop_down_menu_start_range($month_to_preselect_for_start_range=$month_to_preselect_for_start_range);
               ?>
               </td>


               <td>
               <?php
                select_day_drop_down_menu_start_range($day_to_preselect_for_start_range=$day_to_preselect_for_start_range);
               ?>
               </td>
              </table>
             </td>

             <td>
              <table border="1">
              <th align="center">
               <small style="font-size:11px">
               <acronym title="Select END DATE from the drop down menus on your right">END DATE</acronym>
               </small>
              <th>

              <td>
               <?php
                select_year_drop_down_menu_end_range($year_to_preselect_for_end_range=$year_to_preselect_for_end_range);
               ?>
               </td>



               <td>
               <?php
                select_month_drop_down_menu_end_range($month_to_preselect_for_end_range=$month_to_preselect_for_end_range);
               ?>
               </td>



               <td>
               <?php
                select_day_drop_down_menu_end_range($day_to_preselect_for_end_range=$day_to_preselect_for_end_range);
               ?>
               </td>
              </table>
             </td>
            </tr>


            <tr>
             <td colspan="2" style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>

             <td>
              <table border="1">
              <th align="center">
               <small style="font-size:11px">
               <acronym title="Select SART TIME from the drop down menus on your right">START TIME</acronym>
               </small>
              <th>

              <td>
               <?php
                select_hour_drop_down_menu_start_range($hour_to_preselect_for_start_range=$hour_to_preselect_for_start_range);
               ?>
               </td>

               <th>
               :
               </th>

               <td>
               <?php
                select_minute_drop_down_menu_start_range($minute_to_preselect_for_start_range=$minute_to_preselect_for_start_range);
               ?>
               </td>

               <th>
               :
               </th>

               <td>
               <?php
                select_second_drop_down_menu_start_range($second_to_preselect_for_start_range=$second_to_preselect_for_start_range);
               ?>
               </td>
              </table>
             </td>

            
  1. function query_form($node_to_preselect,$user_to_preselect,$day_to_preselect_for_start_range,$month_to_preselect_for_start_range,$year_to_preselect_for_start_range,$hour_to_preselect_for_start_range,$minute_to_preselect_for_start_range,$second_to_preselect_for_start_range,$day_to_preselect_for_end_range,$month_to_preselect_for_end_range,$year_to_preselect_for_end_range,$hour_to_preselect_for_end_range,$minute_to_preselect_for_end_range,$second_to_preselect_for_end_range)
  2.      {
  3.          ?>
  4.          
  5.           
  6.           <table border="1" width="10%">
  7.                                          <form method="post" name="query_form" action="build_query.php">                                        
  8.            <tr>
  9.            <td align="center">
  10.             <table border="1" align="center">
  11.             <tr>
  12.              <th colspan="2">
  13.              <small>
  14.               <acronym title="Select VARIABLES FOR QUERY from the drop down menus below">SELECT VARIABLES FOR QUERY</acronym>
  15.              <small>
  16.              </th>
  17.             </tr>
  18.             <tr>
  19.              <td colspan="2" style="line-height: 10px">
  20.              &nbsp;
  21.              </td>
  22.             </tr>
  23.             <tr>
  24.              <td colspan="2">
  25.              <table border="1">
  26.               <tr>
  27.               <th align="left">
  28.                <small>
  29.                <acronym title="Select NODE from the drop down menu on your right">NODE</acronym>
  30.                </small>
  31.               </th>
  32.               <td colspan="2">
  33.                <?php
  34.                select_node_drop_down_menu($node_to_preselect="");
  35.                ?>
  36.               </td>
  37.               <td>
  38.                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  39.               </td>
  40.               <th align="left">
  41.                <small>
  42.                <acronym title="Select USER from the drop down menu on your right">USER</acronym>
  43.                </small>
  44.               </th>
  45.               <td>
  46.                <?php
  47.                select_user_drop_down_menu($user_to_preselect="");
  48.                ?>
  49.               </td>
  50.               </tr>
  51.              </table>
  52.              </td>
  53.             </tr>
  54.             <tr>
  55.              <td colspan="2" style="line-height: 10px">
  56.              &nbsp;
  57.              </td>
  58.             </tr>
  59.             <tr>
  60.              <th align="center">
  61.              <small style="font-size:13px">
  62.               <acronym title="Select an START RANGE from the drop down menus below">SELECT START RANGE</acronym>
  63.              </small>
  64.              </th>
  65.              <th align="center">
  66.              <small style="font-size:13px">
  67.               <acronym title="Select an END RANGE from the drop down menus below">SELECT END RANGE</acronym>
  68.              </small>
  69.              </th>
  70.             </tr>
  71.             <tr>
  72.              <td colspan="2" style="line-height: 10px">
  73.              &nbsp;
  74.              </td>
  75.             </tr>
  76.             <tr>
  77.              <td>
  78.               <table border="1" width="10">
  79.               <th align="center">
  80.                <small style="font-size:11px">
  81.                <acronym title="Select SART DATE from the drop down menus on your right">START DATE</acronym>
  82.                </small>
  83.               <th>
  84.                <td>
  85.                <?php
  86.                 select_year_drop_down_menu_start_range($year_to_preselect_for_start_range=$year_to_preselect_for_start_range);
  87.                ?>
  88.                </td>
  89.                <td>
  90.                <?php
  91.                 select_month_drop_down_menu_start_range($month_to_preselect_for_start_range=$month_to_preselect_for_start_range);
  92.                ?>
  93.                </td>
  94.                <td>
  95.                <?php
  96.                 select_day_drop_down_menu_start_range($day_to_preselect_for_start_range=$day_to_preselect_for_start_range);
  97.                ?>
  98.                </td>
  99.               </table>
  100.              </td>
  101.              <td>
  102.               <table border="1">
  103.               <th align="center">
  104.                <small style="font-size:11px">
  105.                <acronym title="Select END DATE from the drop down menus on your right">END DATE</acronym>
  106.                </small>
  107.               <th>
  108.               <td>
  109.                <?php
  110.                 select_year_drop_down_menu_end_range($year_to_preselect_for_end_range=$year_to_preselect_for_end_range);
  111.                ?>
  112.                </td>
  113.                <td>
  114.                <?php
  115.                 select_month_drop_down_menu_end_range($month_to_preselect_for_end_range=$month_to_preselect_for_end_range);
  116.                ?>
  117.                </td>
  118.                <td>
  119.                <?php
  120.                 select_day_drop_down_menu_end_range($day_to_preselect_for_end_range=$day_to_preselect_for_end_range);
  121.                ?>
  122.                </td>
  123.               </table>
  124.              </td>
  125.             </tr>
  126.             <tr>
  127.              <td colspan="2" style="line-height: 10px">
  128.              &nbsp;
  129.              </td>
  130.             </tr>
  131.             <tr>
  132.              <td>
  133.               <table border="1">
  134.               <th align="center">
  135.                <small style="font-size:11px">
  136.                <acronym title="Select SART TIME from the drop down menus on your right">START TIME</acronym>
  137.                </small>
  138.               <th>
  139.               <td>
  140.                <?php
  141.                 select_hour_drop_down_menu_start_range($hour_to_preselect_for_start_range=$hour_to_preselect_for_start_range);
  142.                ?>
  143.                </td>
  144.                <th>
  145.                :
  146.                </th>
  147.                <td>
  148.                <?php
  149.                 select_minute_drop_down_menu_start_range($minute_to_preselect_for_start_range=$minute_to_preselect_for_start_range);
  150.                ?>
  151.                </td>
  152.                <th>
  153.                :
  154.                </th>
  155.                <td>
  156.                <?php
  157.                 select_second_drop_down_menu_start_range($second_to_preselect_for_start_range=$second_to_preselect_for_start_range);
  158.                ?>
  159.                </td>
  160.               </table>
  161.              </td>
  162.             
  • darqbluwulf
  • Born
  • Born
  • darqbluwulf
  • Posts: 4

Post 3+ Months Ago

Code: [ Select ]
<td>
              <table border="1">
              <th align="center">
               <small style="font-size:11px">
               <acronym title="Select END TIME from the drop down menus on your right">END TIME</acronym>
               </small>
              <th>

              <td>
               <?php
                select_hour_drop_down_menu_end_range($hour_to_preselect_for_end_range=$hour_to_preselect_for_end_range);
               ?>
               </td>

               <th>
               :
               </th>

               <td>
               <?php
                select_minute_drop_down_menu_end_range($minute_to_preselect_for_end_range=$minute_to_preselect_for_end_range);
               ?>
               </td>

               <th>
               :
               </th>

               <td>
               <?php
                select_second_drop_down_menu_end_range($second_to_preselect_for_end_range=$second_to_preselect_for_end_range);
               ?>
               </td>
              </table>
             </td>
            </tr>
            



            </table>





           <td>
            <table border="2" align="center" width="10%">
            <tr>
             <td>
             &nbsp;
             </td>
            </tr>


            <tr>
             <td>
              <table border="0" align="center">

              <tr>


               <td align="center">
                <!-- PREVIOUS BUTTON -->
                <button type="submit" name="previous_button" value="previous_button">
                <acronym title="Click button to see PREVIOUS 5 records">
                 <b>
                 <small>
                  << 
                 </small>
                 </b>
                </acronym>
                </button>
               </td>

               <td align="center">
                <!-- QUERY BUTTON -->
                <button type="submit" name="query_button" value="query_button">
                <acronym title="Click button to QUERY data in the Database based on the selections made in the above drop down menu">
                 <b>
                 <small>
                   QUERY 
                 </small>
                 </b>
                </acronym>
                </button>
               </td>





               <td align="center">
                <!-- NEXT BUTTON -->
                <button type="submit" name="next_button" value="next_button">
                <acronym title="Click button to see NEXT 5 records">
                 <b>
                 <small>
                   >>
                 </small>
                 </b>
                </acronym>
                </button>
               </td>



              </tr>
             </table>
             </td>
            </tr>











            <tr>
             <td style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>
             <td>

              <tr>
              <td align="center">
               <!-- THIS WEEK REPORT BUTTON -->
               <button type="submit" name="this_week_report_button" value="this_week_report_button">
               <acronym title="Click button to generate THIS WEEKL REPORT of submissions made to the database">
                <b>
                <small>
                 THIS WEEK REPORT
                </small>
                </b>
               </acronym>
               </button>
              </td>
              </tr>

             </td>
            </tr>

            <tr>
             <td style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>
             <td>

              <tr>
              <td align="center">
               <!-- NEXT WEEK REPORT BUTTON -->
               <button type="submit" name="next_week_report_button" value="next_week_report_button">
               <acronym title="Click button to TRY and generate NEXT WEEK REPORT for submissions made to the database">
                <b>
                <small>
                 NEXT WEEK REPORT
                </small>
                </b>
               </acronym>
               </button>
              </td>
              </tr>

             </td>
            </tr>

            <tr>
             <td style="line-height: 10px">
             &nbsp;
             </td>
            </tr>

            <tr>
             <td>

              <tr>
              <td align="center">
               <!-- REFRESH RESULTS BUTTON -->
               <button type="submit" name="refresh_results_button" value="refresh_results_button">
               <acronym title="Click button to REFRESH RESULTS seen in the above table">
                <b>
                <small>
                 REFRESH RESULTS
                </small>
                </b>
               </acronym>
               </button>
              </td>
              </tr>

             </td>
            </tr>

            <tr>
             <td>
             &nbsp;
             </td>
            </tr>

            </tr>
            </table>
           </td>
           </tr>

          </table>
          </form>

         <?
     }
  1. <td>
  2.               <table border="1">
  3.               <th align="center">
  4.                <small style="font-size:11px">
  5.                <acronym title="Select END TIME from the drop down menus on your right">END TIME</acronym>
  6.                </small>
  7.               <th>
  8.               <td>
  9.                <?php
  10.                 select_hour_drop_down_menu_end_range($hour_to_preselect_for_end_range=$hour_to_preselect_for_end_range);
  11.                ?>
  12.                </td>
  13.                <th>
  14.                :
  15.                </th>
  16.                <td>
  17.                <?php
  18.                 select_minute_drop_down_menu_end_range($minute_to_preselect_for_end_range=$minute_to_preselect_for_end_range);
  19.                ?>
  20.                </td>
  21.                <th>
  22.                :
  23.                </th>
  24.                <td>
  25.                <?php
  26.                 select_second_drop_down_menu_end_range($second_to_preselect_for_end_range=$second_to_preselect_for_end_range);
  27.                ?>
  28.                </td>
  29.               </table>
  30.              </td>
  31.             </tr>
  32.             
  33.             </table>
  34.            <td>
  35.             <table border="2" align="center" width="10%">
  36.             <tr>
  37.              <td>
  38.              &nbsp;
  39.              </td>
  40.             </tr>
  41.             <tr>
  42.              <td>
  43.               <table border="0" align="center">
  44.               <tr>
  45.                <td align="center">
  46.                 <!-- PREVIOUS BUTTON -->
  47.                 <button type="submit" name="previous_button" value="previous_button">
  48.                 <acronym title="Click button to see PREVIOUS 5 records">
  49.                  <b>
  50.                  <small>
  51.                   << 
  52.                  </small>
  53.                  </b>
  54.                 </acronym>
  55.                 </button>
  56.                </td>
  57.                <td align="center">
  58.                 <!-- QUERY BUTTON -->
  59.                 <button type="submit" name="query_button" value="query_button">
  60.                 <acronym title="Click button to QUERY data in the Database based on the selections made in the above drop down menu">
  61.                  <b>
  62.                  <small>
  63.                    QUERY 
  64.                  </small>
  65.                  </b>
  66.                 </acronym>
  67.                 </button>
  68.                </td>
  69.                <td align="center">
  70.                 <!-- NEXT BUTTON -->
  71.                 <button type="submit" name="next_button" value="next_button">
  72.                 <acronym title="Click button to see NEXT 5 records">
  73.                  <b>
  74.                  <small>
  75.                    >>
  76.                  </small>
  77.                  </b>
  78.                 </acronym>
  79.                 </button>
  80.                </td>
  81.               </tr>
  82.              </table>
  83.              </td>
  84.             </tr>
  85.             <tr>
  86.              <td style="line-height: 10px">
  87.              &nbsp;
  88.              </td>
  89.             </tr>
  90.             <tr>
  91.              <td>
  92.               <tr>
  93.               <td align="center">
  94.                <!-- THIS WEEK REPORT BUTTON -->
  95.                <button type="submit" name="this_week_report_button" value="this_week_report_button">
  96.                <acronym title="Click button to generate THIS WEEKL REPORT of submissions made to the database">
  97.                 <b>
  98.                 <small>
  99.                  THIS WEEK REPORT
  100.                 </small>
  101.                 </b>
  102.                </acronym>
  103.                </button>
  104.               </td>
  105.               </tr>
  106.              </td>
  107.             </tr>
  108.             <tr>
  109.              <td style="line-height: 10px">
  110.              &nbsp;
  111.              </td>
  112.             </tr>
  113.             <tr>
  114.              <td>
  115.               <tr>
  116.               <td align="center">
  117.                <!-- NEXT WEEK REPORT BUTTON -->
  118.                <button type="submit" name="next_week_report_button" value="next_week_report_button">
  119.                <acronym title="Click button to TRY and generate NEXT WEEK REPORT for submissions made to the database">
  120.                 <b>
  121.                 <small>
  122.                  NEXT WEEK REPORT
  123.                 </small>
  124.                 </b>
  125.                </acronym>
  126.                </button>
  127.               </td>
  128.               </tr>
  129.              </td>
  130.             </tr>
  131.             <tr>
  132.              <td style="line-height: 10px">
  133.              &nbsp;
  134.              </td>
  135.             </tr>
  136.             <tr>
  137.              <td>
  138.               <tr>
  139.               <td align="center">
  140.                <!-- REFRESH RESULTS BUTTON -->
  141.                <button type="submit" name="refresh_results_button" value="refresh_results_button">
  142.                <acronym title="Click button to REFRESH RESULTS seen in the above table">
  143.                 <b>
  144.                 <small>
  145.                  REFRESH RESULTS
  146.                 </small>
  147.                 </b>
  148.                </acronym>
  149.                </button>
  150.               </td>
  151.               </tr>
  152.              </td>
  153.             </tr>
  154.             <tr>
  155.              <td>
  156.              &nbsp;
  157.              </td>
  158.             </tr>
  159.             </tr>
  160.             </table>
  161.            </td>
  162.            </tr>
  163.           </table>
  164.           </form>
  165.          <?
  166.      }



Well there is the code :confused:


This is the code I use for my drop down menu (well one of my drop down menus)


Code: [ Select ]
/* The argument "$node_to_preselect" indicates what node is to be preselected in the drop down menu when the menu is built */

select_node_drop_down_menu($node_to_preselect)
     {
        //Pulls the list of nodes from the DB and dynamically generates the "Node" drop-down menu


        if (db_connect())
        {

           $sqlquery_nodes ="SELECT node_name FROM nodes ORDER BY node_name";
           $result_nodes = mysql_query($sqlquery_nodes);



           //DROP DOWN MENU FOR NODE
           echo "<select name=\"node_selected\">";
            echo "<option value=\"blank_node_selected\">--------- SELECT NODE ----------</option>";
            while($table_row_nodes = mysql_fetch_array($result_nodes))
            {
              if ($node_to_preselect == $table_row_nodes["node_name"])
              {
                 echo'<option value="'.$table_row_nodes["node_name"].'" selected="'.$node_to_preselect.'">'.$table_row_nodes["node_name"].'</option>';
                 $node_to_preselect = "";
              }
              else
              {
                  echo'<option value="'.$table_row_nodes["node_name"].'">'.$table_row_nodes["node_name"].'</option>';
              }

            }
           echo"</select>";

        }
        else
        {

            ?>
            <script>
             alert("ERROR : CANNOT CONNECT TO DATABASE");
            </script>
            <?
            exit;

        }
     }
  1. /* The argument "$node_to_preselect" indicates what node is to be preselected in the drop down menu when the menu is built */
  2. select_node_drop_down_menu($node_to_preselect)
  3.      {
  4.         //Pulls the list of nodes from the DB and dynamically generates the "Node" drop-down menu
  5.         if (db_connect())
  6.         {
  7.            $sqlquery_nodes ="SELECT node_name FROM nodes ORDER BY node_name";
  8.            $result_nodes = mysql_query($sqlquery_nodes);
  9.            //DROP DOWN MENU FOR NODE
  10.            echo "<select name=\"node_selected\">";
  11.             echo "<option value=\"blank_node_selected\">--------- SELECT NODE ----------</option>";
  12.             while($table_row_nodes = mysql_fetch_array($result_nodes))
  13.             {
  14.               if ($node_to_preselect == $table_row_nodes["node_name"])
  15.               {
  16.                  echo'<option value="'.$table_row_nodes["node_name"].'" selected="'.$node_to_preselect.'">'.$table_row_nodes["node_name"].'</option>';
  17.                  $node_to_preselect = "";
  18.               }
  19.               else
  20.               {
  21.                   echo'<option value="'.$table_row_nodes["node_name"].'">'.$table_row_nodes["node_name"].'</option>';
  22.               }
  23.             }
  24.            echo"</select>";
  25.         }
  26.         else
  27.         {
  28.             ?>
  29.             <script>
  30.              alert("ERROR : CANNOT CONNECT TO DATABASE");
  31.             </script>
  32.             <?
  33.             exit;
  34.         }
  35.      }





Yes I kno the code aint as "tight" as it can be...I'm currently in the process of getting rid of unneccessary tags (like acronym) and better implementing the use of CSS. But right now thats the least of my problems....my MAJOR problem is capturing the data from the dropdown menus.
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

Well, browser implementations for the <button> element are shaky, if I remember some random information correctly. IE has problems I thought. I am not sure. I just remembered this.

You may wish to just use <input type="submit" ...> instead, using different name attribute values.

Quote:
Code: [ Select ]
<acronym title="Click button to TRY and generate NEXT WEEK REPORT for submissions made to the database">


You should only be using the <acronym> element if the content of that element is actually an acronym. If you want a tooltip (or whatever generic means of providing such information that a user's browser might implement), put the title attribute on the button element (or the input element) itself. Title attributes can be used on any element.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 47 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.