I need to submit a page to two pages depending on which button is triggering the submit. Both pages needs to be able to pick up the $_POST data being sent. This is what I have so far, but it's not working.
<form name="user" action="" method="POST">
<textarea name="tname" id="tname"></textarea>
<input type='button' value='Submit'
onclick="document.user.action='edit.php'; document.user.submit(); this.form.target='_self'; return true;">
<input type='button' value='Preview'
onclick="document.user.action='preview.php'; document.user.submit(); this.form.target='_blank'; return true;">
</form>
Both pages are opening in the same window (preview button should be opening in a new window).