I have HTML form with three Submit Buttons. One is for reloading the page, the other one makes a database entry and the last one is a simple login button. Each button is also in a div.
When i try to login, i normally enter my username & password and then press enter (Im not tabbing out of the textbox). But instead of pressing the button "login", it presses the button "reload".
I found some ways with Javascript, JQuery and AJAX, but im not allowed to use any of these. All i use is PHP, CSS and HTML.
Is there a way to choose which Button i want to press when i use enter?
edit:
This is the form with the three submit buttons:
<form method="post"action="Sub.php">
<input type="text" id="txt" name="txt" value="text">
<input type="submit" id="refresh" name="refresh" value="Refresh">
<input type="submit" id="update" name="update" value="Update">
<input type="submit" id="login" name="login" value="Login">
<input type="text" id="txt" name="txt" value="text"></form>
This is the file, where i post it.
<?php
if(isset($_POST['login']))
{echo "Login has been pressed";}
if(isset($_POST['update']))
{echo "Update has been pressed";}
if(isset($_POST['refresh']))
{echo "Refresh has been pressed";} ?>
If i tab through the first file and press enter in one of the textboxes, i will allways press the submit button with the value "refresh".