macromedia.coldfusion.getting_started
[Top] [All Lists]

insert values to db based on drop down selected

Subject: insert values to db based on drop down selected
From: "silviasalsa"
Date: Wed, 6 Jun 2007 23:42:01 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

Hello i am trying to add values to the database based on a selection from the 
drop down.
 is this all i need .
 this is not working properly. thanks for any help
 my goal is if they chooses one of the following
 toyo
 hon
 suba 
 it will be inserted into the db.

 THANKS


 i already have the application.cfm
 and i have this as 
 <cfsilent>

 <cfset request.MAINDSN = "Car">

 </cfsilent>

 <!---------------------in the CarMake.cfm------------->


 <form name="myform" action="act_AddCar.cfm" method="POST">
 <div align="center">
 <SELECT name="CarMake" size="1">
 <OPTION Value = "Toyo">Please Select</OPTION>
 <OPTION Value = "Hon" <cfif device_typ is 
"Honda">selected</cfif>>Honda</OPTION>
 <OPTION Value = "Toyo" <cfif device_typis 
"Toyota">selected</cfif>>Toyota</OPTION>
 <OPTION Value = "Suba" <cfif device_typ is 
"Subaru">selected</cfif>>Subaru</OPTION>
 </select>
 </div>
 </form>
 </body>
 </html>
 <!--------------------------act_AddCar.cfm---------->


 <cfquery name="InsertCarInfo"
        datasource="#Request.MainDSN#">
 INSERT INTO Car(
 device_typ
 )
 VALUES (
        '#Trim(Form.CarMake)#',

 </cfquery>



<Prev in Thread] Current Thread [Next in Thread>