Easiest way to do it is using the CFFORM and CFSELECT.  Saves having to go
round in a loop using CFOUTPUT.

<cfform name="addlog" action="index_log.cfm" target="_self">
<table>
  <tr>
    <td>
      User:&nbsp;
    </td>
    <td>
      <cfselect name="sel_user" display="Us_UserName" query="qry_users"
value="Us_UserID">
      </cfselect>
    </td>
  </tr>
</table>
<input type="submit" name="submit" value="submit">
</cfform>

The DISPLAY field in the CFSELECT is the name of the field from the query
(qry_users) that should be displayed in the drop-down.  The VALUE field is
the field that is passed on to the other page (in the ACTION part of the
CFFORM).  The VALUE field (if left out) will default to the DISPLAY field.

Si.

Sponsors of the 1st Northern Information Security Conference
http://www.nisc.org.uk

Sapphire Technologies Ltd.
Secure in the Knowledge
Simon Halcrow   Web Developer   
E  [EMAIL PROTECTED]           
T +44 (0)1642 702100            
F  +44 (0)1642 702119


> -----Original Message-----
> From: Jeff Fongemie [SMTP:[EMAIL PROTECTED]]
> Sent: 19 September 2000 03:10
> To:   Cf-Talk
> Subject:      [CF-Talk] good examples and code of a simple drop down list
> populated from query?
> 
> 
> Hey everyone,
> 
> I'm trying to populate a dropdown list box with the results of a simple
> query.
> 
> I get an error with this:
> 
> <FORM ACTION="data2.cfm" METHOD="Post">
>  <CFOUTPUT><option value="#getarea#">#get area#</option> </CFOUTPUT>
> </select>
> 
>       </p></form>
> 
> Help!??
> 
> Jeff F
> 
> 
> --------------------------------------------------------------------------
> ----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.


-----------------------------------------------
Any opinions expressed in this message are those of the individual and not necessarily 
the company.  This message and any files transmitted with it are confidential and 
solely for the use of the intended recipient.  If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be advised that 
you have received this message in error and that any use is strictly prohibited.

Sapphire Technologies Ltd
http://www.sapphire.net
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to