Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to insert data with radio buttons 1

Status
Not open for further replies.

terrahawk

Technical User
Dec 16, 2001
53
US
Hi, can someone teach me how to submit/insert data from a radio button (or could be a check box) from a ColdFusion page to my MS SQL 2000 database or point me to the appropriate resource? I can get my <CFINPUT TYPE="Text" data inserted to the database but I understand that I need to do a further step with the radio buttons/check boxes. Sample is below

<CFFORM ACTION="InsertCompany.cfm" METHOD="POST" >

<TD>Account assigned to<br>
(choose one):</TD>
<TD>
<CFINPUT TYPE="radio" name="staffid" value="3">Bryan<br>
<CFINPUT TYPE="radio" name="staffid" value="5">Mark <br>
<CFINPUT TYPE="radio" name="staffid" value="2">Mary-<br>
<CFINPUT TYPE="radio" name="staffid" value="4">Nancy<br>
<CFINPUT TYPE="radio" name="staffid" value="6" checked>Peter<br>
<CFINPUT TYPE="radio" name="staffid" value="1">Rich Hamer</TD> </TR>
</CFFORM>


Thanks,
Peter
 
terrahawk, what does your <cfinsert> statement look like?? If you're doing something like: <cfinsert formfields="staffid" datasource="yourDB" tablename="table1"> then there is no reason why the value isn't being saved in the dB.


____________________________________
Just Imagine.
 
Thank-you GUIJUmOdeL - just for the suggestion! Duh, I forgot to include that variable in my insert page:

<CFINSERT DATASOURCE="isyonline" TABLENAME="tblcompany" FORMFIELDS="
staffid,
companyname,
mainweb,
companynotes">

I put in staffid and it worked fine and inserted the value in the database.

I may post again as I try some other input methods.

Thanks,
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top