April 16, 2012
Submitting multi-stage form using .load method
Question by methuselah
I’ve been looking at this multi-stage form at http://jsfiddle.net/xSkgH/89/ and was just wondering about the best way of submitting the form using the .load method.
I’ve been trying this so far:
<script type="text/javascript">
$(document).ready(function() {
$("#last-step").hide(300).show(300).$load("resources/process.php",
$("#task5_booking").serialize());
}
</script>
But it doesn’t seem to be working. Any hints?
Thanks in advance!
Answer by Starx
Few typos on your code.
- $.post chained with previous statements
- Sending a post request with serialized data in the wrong way.
Update your code like this
$("#last-step").hide(300).show(300);
$.post(
"resources/process.php",
{ data: $("#task5_booking").serialize() }
);