One html form with two submit buttons. On submit (save changes) posts back to the same page and updates a database. The other submit button (preview) should open a pop-up showing what the data would look like if the user should press save.
My efforts so far:
This might not look like much of an effort but, trust me, I took a long time to get this far!
I have figured out how to open the pop-out using this code:
<form action="index.php" method="post"> <input type="text" name ="text_1" value="default" /><br /> <textarea name="text_2">default</textarea><br /> <input type="submit" value="preview" onclick="window.open('preview.php', '', 'width=400 height=500')" /><br /> <input type="submit" value="save changes" /> </form>
How do I submit the form data to the pop up? I have arrived at some solutions using onsubmit in the form tag but that messes up the 'save changes' action.
Any help would be so gratefully received,