OK then use Misha's example there is a small typo: Change: <cfqueryparam value="#form.statecodeID>#" type="cf_sql_int">
to <cfqueryparam value="#form.statecodeID>#" cfsqltype="cf_sql_int"> Paul. -----Original Message----- From: Barry Mcconaghey [mailto:[email protected]] Sent: Sunday, August 30, 2009 11:15 AM To: cf-newbie Subject: Re: CFInsert Form (Success Message) Hi Misha. I added your code but I got an error message: Attribute validation error for tag CFQUERYPARAM. The tag does not allow the attribute(s) TYPE. The valid attribute(s) are CFSQLTYPE,LIST,MAXLENGTH,NULL,SCALE,SEPARATOR,VALUE. Barry >One of the method it can be done: > >*************************************************************************** * >************************* ><cfquery name="States" datasource="#request.dsn#" username="#request.un#" >password="#request.pw#"> > SELECT statecodeID, statename > FROM states ></cfquery> > ><cfselect name="statecodeID" size="1" class="input-text"> > <cfoutput query="States"> > <option value="#statecodeID#">#statename#</option> > </cfoutput> ></cfselect> > > ><cfif IsDefined('form.statecodeID ') AND form.statecodeID GT 0> > > <cfquery name="qry" dbtype="query"> > SELECT statecodeID, statename > FROM States > WHERE statecodeID = <cfqueryparam value="#form.statecodeID >#" type="cf_sql_int"> > </cfquery> > > <cfoutput> > State - #qry.statename# > </cfoutput> ></cfif> >*************************************************************************** * >*********************** > > >Regards, >Misha > > >Hello. > >I have a form on my website: > ><cfquery name="States" datasource="#request.dsn#" username="#request.un#" >password="#request.pw#"> >SELECT statecodeID, statename >FROM states ></cfquery> > ><cfselect name="statecodeID" size="1" class="input-text"> > <cfoutput query="States"> > <option value="#statecodeID#">#statename#</option> > </cfoutput> ></cfselect> > >When a user submits this form, a number for the statename is entered into >the database. For example: Florida is 34. > >I want to display on my cfform action page the statename not the number from >the form. > >The cfform action page now: > ><cfoutput> >State - #FORM.statecodeid# ></cfoutput> > >Display Message Now: > >State - 34 > >I want it to display: > >State - Florida > >Thanks, > >Barry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4795 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
