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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Action page does not update / insert data into database

Status
Not open for further replies.

roropacific

IS-IT--Management
Jun 29, 2002
23
US
Here is the form

<html>
<head>
<title>Customer Service FeedBack Form</title>
</head>
<body>
<h1>Customer Service FeedBack Form</h1>
<hr>
<FORM method=&quot;post&quot; action=&quot;doregister.cfm&quot; name=&quot;Customer Service Feedback&quot;>&#13;&#10;<ol>&#13;&#10;<li>&#13;&#10;&#13;&#10;
<table>
<tr>
<td ALIGN=&quot;right&quot;><em>Service Agent</em></td>
<td><input TYPE=&quot;TEXT&quot; NAME=&quot;user_name&quot; SIZE=&quot;25&quot;></td>
</tr>
</table>
<tr>
<td ALIGN=&quot;right&quot;><em>Model Number</em></td>
<td><input TYPE=&quot;TEXT&quot; NAME=&quot;Product_id&quot; SIZE=&quot;25&quot;></td>
</tr>
</table>

<li>
<p>Issue Title</p>
<p><TEXTAREA name=Summary cols=35></TEXTAREA><br>
</p>
<li>
<p>Issue Description</p>
<p><TEXTAREA name=Description rows=5 cols=35></TEXTAREA><br>
</p>
<li>
<p>Please provide the following contact information:</p>
<table>
<tr>
<td ALIGN=&quot;right&quot;><em>First Name</em></td>
<td><input NAME=&quot;Contact_FirstName&quot; SIZE=&quot;25&quot;></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>Last Name</em></td>
<td><input NAME=&quot;Contact_LastName&quot; SIZE=&quot;25&quot;></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>Street Address</em></td>
<td><input NAME=&quot;Contact_StreetAddress&quot; SIZE=&quot;25&quot; ></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>Address (cont.)</em></td>
<td><input NAME=&quot;Contact_Address2&quot; SIZE=&quot;25&quot; ></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>City</em></td>
<td><input NAME=&quot;Contact_City&quot; SIZE=&quot;25&quot;></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>State/Province</em></td>
<td><input NAME=&quot;Contact_State&quot; SIZE=&quot;2&quot;></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>Zip/Postal Code</em></td>
<td><input NAME=&quot;Contact_ZipCode&quot; SIZE=&quot;10&quot; MAXLENGTH=&quot;10&quot; ></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>Home Phone</em></td>
<td><input NAME=&quot;Contact_HomePhone&quot; SIZE=&quot;12&quot; MAXLENGTH=&quot;12&quot; ></td>
</tr>
<tr>
<td ALIGN=&quot;right&quot;><em>E-mail</em></td>
<td><input NAME=&quot;Contact_Email&quot; SIZE=&quot;25&quot;></td>
</tr>
</table>
<li>
<p>Enter the date of Purchase :</p>
<p><input NAME=&quot;purchaseDate&quot; size=&quot;10&quot; MAXLENGTH=&quot;10&quot;>
</p>
<li>
<p>Location of Purchase</p>
<p><input NAME=&quot;purchaseplace&quot; SIZE=&quot;50&quot; MAXLENGTH=&quot;50&quot;><br>


<OL></OL>
<input type=&quot;SUBMIT&quot; value=&quot;Add Customer&quot; name=&quot;SUBMIT&quot;>
<input type=reset value=&quot;Reset Form&quot;>
<A href=&quot;menu1.htm&quot;> View Reports</A>
<A href=&quot;search1.htm&quot;> Search for Product ID</A>
<A href=&quot;search2.htm&quot;> Search for Keyword</A>
</FORM></LI></body></HTML>

Here is the action file
<cfoutput>
<CFQUERY NAME=&quot;adduser&quot; DATASOURCE=&quot;custsrvc&quot;>
INSERT INTO complaint
(product_id,
issue_summary,
issue_description,
DateofPurchase ,
LocationofPurchase,
custfirstname ,
custlastname ,
custaddress ,
custaddress2 ,
custcity,
custstate,
custzip,
custphone ,
custemail ,
currentdate,
username)
VALUES
('#form.product_model#',
'#form.summary#',
'#form.description#',
'#form.purchasedate#',
'#form.purchaseplace#',
'#form.contact_firstname#',
'#form.contact_lastname#',
'#form.cont_streetaddress#',
'#form.contact_address2#',
'#form.contact_city#',
'#form.contact_state#',
'#form.contact_zipcode#',
'#form.contact_homephone#',
'#form.contact_email#',
'#form.purchasedate#',
'#form.user_name#')
</CFQUERY>


Record added.
</cfoutput>
 
Do you get any sort of error, or does it just not update the database and pretend everything's fine?

You can try to output the SQL just to make sure it is what you expect... just comment out your <CFQUERY> tags (since you already have <CFOUTPUT>s surrounding everything) so that all the OK page does is display the SQL that would've run. And check it against your expectations.

You can also add a CFDUMP at the top of the page to make sure all the form fields are named and filled as you expect:
Code:
<CFDUMP var=&quot;#FORM#&quot;>




-Carl
 
Correct,
I am using the correct data source.

I do not get anything it is wierd.
 
I can only think of a few basic things to check for. For starters, make sure that your &quot;action&quot; in the form is pointing to the right page. Also, try commenting out EVERYTHING in your action page and then just putting a simple line of text (uncommented) at the top of the page. That way, there is no cf processing done on the action page, but you can verify that cf can reach the page and return info from it. You may want to turn on cf debugging as well, just to take a look at it and see what cf sees on the page.

Hope This Helps!

Ecobb
- I hate computers!
 
I figured it out. I was using wordpad. When I changed to opening and saving the file in notepad everything works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top