Skip navigation
Currently Being Moderated

2 columns dropdown

Feb 15, 2013 4:04 PM

I would like to have a dropdown box 2 columns like employeeNO and EmployeeName.

It think that I only can have one column from my recordset.

I tried to add a new column from my recordset, but I am unable to add extra field.

I would like to know does DreamWeave allow me to do this or I am not on the right track.

 

Your help and information is great appreciated,

 

 

regards,

 

Iccsi,

 
Replies
  • Currently Being Moderated
    Feb 16, 2013 6:01 AM   in reply to iccsi

    After having created the dropdown list using DW, you will see somthing like

    <select name="mySelect">

      <?php

    do { 

    ?>

      <option value="<?php echo $row_rsEmployees['UserID']?>"><?php echo $row_rsEmployees['UserID']?></option>

      <?php

    } while ($row_rsEmployees = mysql_fetch_assoc($rsEmployees));

      $rows = mysql_num_rows($rsEmployees);

      if($rows > 0) {

          mysql_data_seek($rsEmployees, 0);

          $row_rsEmployees = mysql_fetch_assoc($rsEmployees);

      }

    ?>

    </select>

    Open the bindings window select and drag the field name to the option

    _Capture.jpg

    to finish up with something like

    <select name="mySelect">

      <?php

    do { 

    ?>

      <option value="<?php echo $row_rsEmployees['UserID']?>"><?php echo $row_rsEmployees['UserID']?> - <?php echo $row_rsEmployees['UserFirstName']; ?> <?php echo $row_rsEmployees['UserLastName']; ?></option>

      <?php

    } while ($row_rsEmployees = mysql_fetch_assoc($rsEmployees));

      $rows = mysql_num_rows($rsEmployees);

      if($rows > 0) {

          mysql_data_seek($rsEmployees, 0);

          $row_rsEmployees = mysql_fetch_assoc($rsEmployees);

      }

    ?>

    </select>

    I know that you are using CF and the above example uses PHP, but the principle remains the same.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 16, 2013 6:43 AM   in reply to iccsi

    From memory, more than 10 years ago, I think it is <cfoutput>#messgae#</cfoutput>

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 16, 2013 7:06 AM   in reply to iccsi

    That is correct, you should have

    <cfoutput query="Recordset1">
          <option value="#Recordset1.EmpID#">#Recordset1.EmpID# - #Recordset1.FirstName#</option>
    </cfoutput>
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points