troubleshooting Question

Update database without refreshing page

Avatar of Qsorb
QsorbFlag for United States of America asked on
JavaScriptColdFusion LanguageAJAX
4 Comments2 Solutions454 ViewsLast Modified:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shopping Cart</title>
<style type="text/css">
<!--
.delbtn {
	background: url("/a/delbtn-x.png") no-repeat;
	font-weight: bold;
	text-decoration: none;
	display: block;
}
.delbtn:hover {
	background: url("/a/delbtn.png") no-repeat;
}
-->
</style>
</head>
<body>
<iframe name="brain" src="" width="0" height="0" marginwidth="0" marginheight="0" frameborder="0"></iframe>
<cfquery name="ServicesInfo" datasource="NEWSB">
 select *
 from services
 where id =1

</cfquery>
<cfoutput query="ServicesInfo">
 <table border="1">
  <tr>
   <td>Title</td>
   <td>Remove</td>
  </tr>
  <tr>
   <td>#package#</td>
   <INPUT CLASS="delbtn" TYPE="text" NAME="#Title#" VALUE=" &nbsp; " SIZE="4" MAXLENGTH="4" onChange="brain.location='/service/update.cfm?id=4;">
   </td>
  </tr>
 </table>
</cfoutput>
</body>
</html>

This example shopping cart test page will be open to the public on the web so it has to work in all major browsers.

I want to update a choice in our sql2000 database, similar to what Netfix does when one clicks on the big X to remove a DVD from the list of DVD titles in the "Your Queue" page. The image here is the X. That works here. That's not the problem.

In any event, the code I'm using does not work. I want to use the best possible choice, even if it means I take some time to understand it, and it may take more than one question.

Can someone help, or point me to a clear, basic example how to achieve what I want. I'm a novice and need this explained, what needs to be done to call my update.cfm without moving away from the current page or refreshing it.

Also, I'm not at all certain if using iframe could be a problem, if it could be seen as a pop up.


ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros