Hey Everyone,
well basically what i am trying to do is update information in a database using ajax. I have it working except this one part
Here is the javascript
<script type="text/javascript" language="javascript">
var http_request = false;
function makePOSTRequest(url, parameters) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xm...
http_request.overrideMimeType('text/html...
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.
XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open("POST", "resubmitform1.cfm", true);
http_request.setRequestHeader("Content-t... "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-l... parameters.length);
http_request.setRequestHeader("Connectio... "close");
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
document.getElementById('myspan').
innerHTML = result;
} else {
alert(http_request.responseText);
alert('There was a problem with the request.');
}
}
}
function get(obj) {
var poststr =
"title=" + encodeURI(document.getElementById
("title").value)+
"&priority=" + encodeURI(document.getElementById
("priority").value)+
"&status=" + encodeURI(document.getElementById
("status").value)+
"&last_edited_by=" + encodeURI(document.getElementById
("last_edited_by").value)+
"&custnum=" + encodeURI(document.getElementById
("custnum").value)+
"&compname=" + encodeURI(document.getElementById
("compname").value)+
"&fname=" + encodeURI(document.getElementById
("fname").value)+
"&lname=" + encodeURI(document.getElementById
("lname").
value)+
"&address=" + encodeURI(document.getElementById
("address").value)+
"&city=" + encodeURI(document.getElementById
("city").
value)+
"&state=" + encodeURI(document.getElementById
("state").
value)+
"&zip=" + encodeURI(document.getElementById
("zip").
value)+
"&email=" + encodeURI(document.getElementById(
"email").
value)+
"&priphone=" + encodeURI(document.getElementById
("priphone").value)+
"&secphone=" + encodeURI(document.getElementById
("secphone").value)+
"&custnotes=" + encodeURI(document.getElementById("custn...
"&costcenterid=" + encodeURI(document.getElementById
("costcenterid").value)+
"&htpp=" + encodeURI(document.getElementById
("htpp")
.checked)+
"&ID=" + encodeURI(document.getElementById
("ID").value);
makePOSTRequest('resubmitform1.cfm', poststr);
}
</script>
an here is the resubmitform1.cfm page
<cfquery name="updatecontacts" datasource=
"CustomerSupport">
exec usp_CS_Updatecontacts '#Form.custnum#',
'#Form.compname#','
#Form.fname#',
'#Form.lname#','
#Form.address#',
'#Form.city#',
'#Form.state#','
#Form.zip#','
#Form.email#','
#Form.priphone#','
#Form.secphone#','
#Form.custnotes#'
</cfquery>
all the code above works correctly. until i try to put 2 stored procedures into resubmitform1.cfm. what i am trying to do is put the same information into 2 tables. however, when i put the second table into resubmitform1.cfm it will not update it at all. all the fields are the same name, but it still will not update correctly here is the second stored procedure i try to add to resubmitform1.cfm
<cfquery name="updatecontacts" datasource="CustomerSupport">
exec usp_CS_Updatecontacts '#Form.custnum#','
#Form.compname#',
'#Form.fname#',
'#Form.lname#',
'#Form.address#','
#Form.city#','
#Form.state#','
#Form.zip#','
#Form.email#','
#Form.priphone#'
,'#Form.secphone#','
#Form.custnotes#'
</cfquery>
but thank you to all who help :)
Rach
Tags: