You could echo HTML code e.g.
Which is still purely HTML and has nothing whatsoever to do with PHP.
<form action="result.php" method="post">
Number: <input id="quantity" type="text" />
<button type="button" onclick="OpenWindow()">Submit</button>
</form>
or include it as one of your form attributes:
<form action="demo_form.asp" method="get" target="_blank">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
Again, pure HTML, and no PHP involved. Specifically, the (asp??) page
called in the form action handler will never even be aware of the fact
that the page was opened in a new window, or at least was supposed to.
I was using an example and NOT intended to show ASP.
target="_blank" will open a new window every time. That will defeat the purpose.
I have many different submit buttons, for different purposes. Depending on the $_POST value of each submit button, I tell PHP to do different things,
<input value="Update" type="submit"> <input name="DPRmode" value="Enter Data" type="submit">
I want to open a different window when I press: <input name="DPRmode" value="Enter Data" type="submit">
I guess the best I can hope for is to try
<input name="DPRmode" value="Enter Data" type="submit" onclick="OpenWindow()">
<button type="button" onclick="OpenWindow()">Submit</button> will not submit the form contents.
Thanks,