I have a script choosing a second action on a form with one of two buttons calling the script that keeps opeing TWO new windows (and writing to my db twice! yeck!):
[CODE]
function OnButton1() {
document.form.action = “prev_post.php”
// document.form.target = “_blank”; // Open in a new window
document.form.submit(); // Submit the page
}
function OnButton2() {
document.form.action = “formProcess.php”
// document.form.target = “_blank”; // Open in a new window
document.form.submit(); // Submit the page
}
with the form tag thus:
<form method=”post” name=”form” id=”form” />
and the buttons:
[CODE]<input type=”image” src=”images/preview.gif” border=”0″ name=button1 onClick=”OnButton1();”>
<input type=”image” src=”images/preview.gif” border=”0″ name=button2 onClick=”OnButton2();”>
can someone kindly tell me what the heck is going on, or perhaps show me a better way to accomplish this…?
Many thanks
GN