I admit its not very clear title. But I did not know how else to name what I am trying to do.
I have index.htm. this page pulls data from index.asp?Process=ViewRequests with the following code.
$(function Requests() {
$.ajax({
type: 'GET',
url: 'content/requests/index.cs.asp?Process=ViewRequests',
success: function(data) {
$("#requests").html(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$("#requests").html('.');
}
});
});
Then, in this new pulled data set, I have a few forms. All forms have REQUESTFORM as ID and submit buttons' name is respond. What I need it needs to perform; once user clicks on either of these forms, clicked form should send its data to index.asp?Process=RespondRequests and print its response.
$("[name='respond']").click(function() {
$.ajax({
type: "POST",
data: $("#REQUESTFORM").serialize(),
url: "content/requests/index.cs.asp?Process=RespondRequests",
success: function(output) {
$('#REQUESTFORM').html(output)
},
error: function(output) {
$('#REQUESTFORM').html(output);
}
});
});
Is this even possible?