从预览页面提交表单

I have a form that I've been working on for a project. On it, there are a couple buttons, one that resets it, one that submits it, and one that previews the submission. The preview button opens up a separate php page on top of the form using this:

<a class="preview" data-fancybox-type="ajax" href="preview.php" id="reset">Click to preview submission</a>

And the submit button (on the original page) submits the page and sends the data to the server using:

<input type="submit" value="Save" id="saved" name="saved" onClick="return showConfirm();"  />

However, I cannot seem to get the preview page to have a functioning submit button. I'm wondering if there's a way on the preview page to do that? The button on the preview page that closes the preview page and returns to the main page is this:

<p align="right">
<span id="reset">Click Here To Close Page</span></p>

Opening and closing the preview page doesn't affect the data in the original form.

If I uderstood.

You should store your variables in a sesseion.

Check this tutorial will help you:

http://www.w3schools.com/php/php_sessions.asp

I'm not very sure if I understood you, but I'll try to answer...

There is a easier way to do this. What you can do is put the preview.php page inside an <iframe> on the page that has the form, but NOT showing yet. So, when a person clicks on the preview button, it makes a preview editing the preview.php page (Basically, I think it was what you did) and call it to show on the iframe (you can do it with javascript). So, you don't need to modify the submit button and stuff.

I don't know if you could understand me, but it's not a very tricky idea.


Sorry for my bad english.