I have a form with two submit buttons, button A and button B.
I want button A to submit the form to a new window, but I want button B to keep it in the same window.
Here is the code I’ve got it working so that it will make both buttons submit the form into new windows:
[code=php]<html>
<head>
<title>Untitled</title>
<script>
function doSomething(form) {
var w = window.open(”,’new_window’);
form.target = ‘new_window’;
}
</script>
</head>
<body>
<form action=”index.php” name=”form” onsubmit=”doSomething(this);”>
<p><input type=”submit” name=”button A” /><input type=”submit” name=”button B” /> </p>
</form>
</body>
</html>
But how do I get Button B to submit the form to index.php in the current window while Button A still submits the form to index.php in a new window?
Any help is much appreciated.