I am having some trouble sending values from one page to another using the jQuery ajax() function.
For some reason the request.form on my VBscript page won't pick up the data I send using the ajax() function in jQuery.
Here is my javascript function which is called in an onsubmit event in my form:
function sendData() {
$.ajax({
type: "POST",
url: "/useData.asp",
data: {
newData: $("form[name=myData] [name=newData]").val()
},
success: function(response) {
$("#responseData").html(response);
},
error: function(xhr) {
alert("Error: " + xhr.status);
}
});
return false;
}
And here is my VBscript:
<%=request.form("newData")%>
For some reason when I use POST I don't get any data returned in the responseData div. But if I change POST to GET and request.form to request.queryString I get my data as I should do.
Can anybody tell me why POST and request.form are not working?