I have a problem when I want to use a button to switch into another page, and another button to just close the window (a popup)
No matter which button I click, the form submits. What can I do to avoid this (apart from switching the </form>
between the two buttons) ?
The code:
<form action="name.php" method="post">
<input type="hidden" name="number" value="<?php echo $id;?>">
<input type="hidden" name="position" value="<?php echo $pos;?>">
<button type="submit">Yes</button> <button onclick="window.close()">No</button>
</form>
<button>
tag to close the window. Use anchor link and javascript. This would be more semantically appropriate.