Hey, I'm somewhat COMPLETELY new to ColdFusion. I'm trying to accomplish some form-related tasks. Basically, what I have now is a form w/ a few textfields and checkboxes. Basically, the names of the checkboxes correspond to the tables in the database. So, whichever checkboxes are checked, I want to send the information in the txtboxes to those particular table in the database. As of now, all the values of the checkboxes is 1. Here's some code to support the above :
iccinput.cfm
<form enctype="multipart-form-data" method="post" action="iccupload.cfm" name="upload">
(I'm also uploadin a file, hence the enctype)
<table width="100%" border="1" cellspacing="8">
Your Name <input name="txtName" size="30" maxlength="255">
Title for your Document<input name="txtSubject" size="50" maxlength="255" >
Description <TEXTAREA name="txtDesc" rows="5" cols="50"></TEXTAREA>
<input type="file" name="fileUp" size="40" maxlength="255">
Departments
<input type="checkbox" name="cboxFinancial" value="1">
<input type="checkbox" name="cboxManufacturing" value="1">
and a bunch of other departments set up exactly like this...
so basically, I dont know where to put the SQL statement...since the form action is "iccupload.cfm" do I insert the sql statment there? That is where I currently have it:
iccupload.cfm
<html>
<head>
<CFQUERY NAME="insertFinancial" DATASOURCE="iccupload">
<cfif form.cboxFinancial is "1">
INSERT INTO FINANCIAL (NAME, SUBJECT, DESCRIPTION,)
values
(#Form.txtName#,#Form.txtSubject#,#Form.txtDesc#)
</cfif>
</CFQUERY>
</head>
<body>
</body>
</html>
that is what my whole iccupload.cfm file looks like. Do I need to add anything to it to link it to the previous page (iccinput2.cfm)?
This is the error I'm getting w/ the current code:
Syntax error in INSERT INTO statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (8:1) to (8:55).
iccinput.cfm
<form enctype="multipart-form-data" method="post" action="iccupload.cfm" name="upload">
(I'm also uploadin a file, hence the enctype)
<table width="100%" border="1" cellspacing="8">
Your Name <input name="txtName" size="30" maxlength="255">
Title for your Document<input name="txtSubject" size="50" maxlength="255" >
Description <TEXTAREA name="txtDesc" rows="5" cols="50"></TEXTAREA>
<input type="file" name="fileUp" size="40" maxlength="255">
Departments
<input type="checkbox" name="cboxFinancial" value="1">
<input type="checkbox" name="cboxManufacturing" value="1">
and a bunch of other departments set up exactly like this...
so basically, I dont know where to put the SQL statement...since the form action is "iccupload.cfm" do I insert the sql statment there? That is where I currently have it:
iccupload.cfm
<html>
<head>
<CFQUERY NAME="insertFinancial" DATASOURCE="iccupload">
<cfif form.cboxFinancial is "1">
INSERT INTO FINANCIAL (NAME, SUBJECT, DESCRIPTION,)
values
(#Form.txtName#,#Form.txtSubject#,#Form.txtDesc#)
</cfif>
</CFQUERY>
</head>
<body>
</body>
</html>
that is what my whole iccupload.cfm file looks like. Do I need to add anything to it to link it to the previous page (iccinput2.cfm)?
This is the error I'm getting w/ the current code:
Syntax error in INSERT INTO statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (8:1) to (8:55).