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() }
);

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!