Jump to content

[SOLVED] Dynamic Drop Menu Question


Zergman

Recommended Posts

Thanks aeonsky, I sorta can see from your example, but trying to adapt it to my select box is causing a few issues.

 

Here's what I got so far, unsure how to add one value to the top of the dropdown before the dynamic stuff.

<select name="tracking" class="inputbox" id="tracking">
          <?php
do {  
?>
          <option value="<?php echo $row_rsmenufield['value']?>"><?php echo $row_rsmenufield['value']?></option>
          <?php
} while ($row_rsmenufield = mysql_fetch_assoc($rsmenufield));
  $rows = mysql_num_rows($rsmenufield);
  if($rows > 0) {
      mysql_data_seek($rsmenufield, 0);
  $row_rsmenufield = mysql_fetch_assoc($rsmenufield);
  }
?>
</select>

 

Please pardon my sloppy code :) 

Cool, figured it out.

 

I know this isn't the best solution but it works for now.

 

<select name="tracking" class="inputbox" id="tracking">
        <option value="n/a">n/a</option>
        <?php
do {  
?>
        <option value="<?php echo $row_rsmenufield['value']?>"><?php echo $row_rsmenufield['value']?></option>
          <?php
} while ($row_rsmenufield = mysql_fetch_assoc($rsmenufield));
  $rows = mysql_num_rows($rsmenufield);
  if($rows > 0) {
      mysql_data_seek($rsmenufield, 0);
  $row_rsmenufield = mysql_fetch_assoc($rsmenufield);
  }
?>
</select>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.