ok first off, you are already loading the jquery framework so you dont need that old script you added to load pages using ajax.
then you can replace :
Code:
ajaxpage('/staffpanel/_frontend/requests.php', 'request')
with:
Code:
$("#request").load('/staffpanel/_frontend/requests.php')
even then, you are still loading an entire webpage into another one. PHP has a way to response with everything in the body element of a page if being requested by ajax, but I dont knwo how to do it.
then , also, you would need to include the css from requests.php. best way is using an external css file
after all that is handled,
here is an example of what you are looking for:
Code:
$(function () {
$("#idofrequestform").live("submit", function (e) {
e.preventDefault(); //prevernt default form sumbit action
var SubmitURL = "/staffpanel/_frontend/requests.php";
var dataString = $('#responseForm').serialize();
$.ajax({
type: "POST",
url: SubmitURL,
data: dataString,
success: function () {
alert("request sent!")
}
return false;
});
});
you would put that right after the .load code