Thanks all for the help!!!
Jeff Giesbrecht
-----Original Message-----
From: Emilio [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 7:44 PM
To: Fusebox
Subject: Re: Simple question...
In the resueform.zip file from Fusebox.org is a txt file with this in it.
<snip>
<cfparam name="attributes.userid" default="0">
<cfquery name="getuser" datasource="#application.mainDSN#">
select email,firstname,lastname,gender
from userid
where userid=#val(attributes.userid)#
</cfquery>
<!--- This will check to see whether the data should be displayed from
the database or create a new record --->
<cfparam name="attributes.displayaction" default="new">
<cfif getproject.recordcount and attributes.displayaction is not "form" or
attributes.displayaction is not "url">
<cfset attributes.displayaction="query">
</cfif>
<cf_reuseform
Action="#attributes.displayaction#"
datasource="#application.MainDSN#"
fieldlist="email,firstname,lastname,gender"
queryname="getuser">
<!--- Note the value of each field is coming from the <cf_reuseform> tag,
depending on the action will determine where the data comes from, i.e.
blank, query data
form data or url data (the last two are for data validation)--->
<form method="post"
action="index.cfm?<cfoutput>#client.urltoken#</cfoutput>">
<cfoutput>
firstname: <input type="Text" name="firstname" value="#firstname#"><br>
lastname: <input type="Text" name="lastname" value="#lastname#"><br>
email: <input type="Text" name="email" value="#email#"><br>
Gender:
<select name="gender">
<option value="Male" <cfif gender is "Male">selected</cfif>>Male
<option value="Female" <cfif gender is "Female">selected</cfif>>Female
</select>
<input type="Submit">
</cfoutput>
</form>
NOTE: If you wish to assign a value to a field use a ";" between the
fieldname and its value!
EX:fieldlist="email,firstname;Bob,lastname;Sugar,gender;Bender"
</snip>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists