I've done it with something like this before in jQuery (not sure if it's the "best" way, but it works):
function jsonhandler(data) {
// do stuff with the JSON data here
}
var doajax = function () {
arr = Object();
$("#form_id").children("input,select").each(function() { arr[this.name] = this.value;});
$.getJSON("<page to call with AJAX>", arr, function (data) { jsonhandler(data);});
}
$(document).ready(function () {
$("#submit_button_id").replaceWith("<input id=\"sub\" name=\"sub\" type=\"button\" value=\"Submit\">");
$("#sub").click(doajax);
}
You can replace the $.getJSON with whichever jQuery AJAX function does what you want. If you just want to display the output of the page you're calling, $.get is probably your best bet. If you have other input types besides input and select in your form, you'll need to add those to the children function as well.