how to pass values from one page to another on jquery form submit

Posted by andy787899 on Stack Overflow See other posts from Stack Overflow or by andy787899
Published on 2010-03-08T03:10:21Z Indexed on 2010/03/08 3:17 UTC
Read the original article Hit count: 372

Filed under:
|
|
|

I'm trying to build a form using php & jquery, but I'm a little confused as to what to do with the jquery portion of it...

Basically, when the user submits the first form, I want to direct them to the "next step" form, but I want to retain the values submitted from the first one in a hidden input field...

If someone can either show me how or point me to a good tutorial, I'd appreciate it...

I don't have any of the php or jquery yet, and this is just a simplified version of the html markup...

//first.php
<form name="form1" method="post" action="second.php">
<input type="text" name="name" value="" />Name
<input type="submit" name="step1" value="Next" />
</form>

//second.php
<form name="form2" method="post" action="process.php">
<input type="hidden" name="name" value="{$_POST['name']}" />
<input type="text" name="message" value="" />message
<input type="submit" name="step2" value="Finish" />
</form>

© Stack Overflow or respective owner

how to pass values from one page to another on jquery form submit

Posted by andy787899 on Stack Overflow See other posts from Stack Overflow or by andy787899
Published on 2010-03-08T03:10:21Z Indexed on 2010/03/08 3:30 UTC
Read the original article Hit count: 372

Filed under:
|
|
|

I'm trying to build a form using php & jquery, but I'm a little confused as to what to do with the jquery portion of it...

Basically, when the user submits the first form, I want to direct them to the "next step" form, but I want to retain the values submitted from the first one in a hidden input field...

If someone can either show me how or point me to a good tutorial, I'd appreciate it...

I don't have any of the php or jquery yet, and this is just a simplified version of the html markup...

//first.php
<form name="form1" method="post" action="second.php">
<input type="text" name="name" value="" />Name
<input type="submit" name="step1" value="Next" />
</form>

//second.php
<form name="form2" method="post" action="process.php">
<input type="hidden" name="name" value="{$_POST['name']}" />
<input type="text" name="message" value="" />message
<input type="submit" name="step2" value="Finish" />
</form>

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery