<form method="post" action="confirm_login_credentials.php"> <table> <tr> <td>User ID:</td> <td><input type="text" id="uid"></td> </tr> <tr> <td>Password:</td> <td><input type="text" id="pass"></td> </tr> <tr> <td colspan="2" align="right"> <a href="#"><img src="images/login.jpg"></a> </td> </tr> </table> </form>
I am using an image in place of a submit button. How can I submit the login details when the user clicks on the login image as a submit button does?
Definition and UsageThe <input type="image"> defines an image as a submit button. The path to the image is specified in the src attribute.
PDF Studio is capable of creating an image import button to allow users to insert images into the PDF document when completing a form. This button is the same as a standard button only that it has specific settings and JavaScript set automatically to make it work as an image import button.
You could use an image submit button:
<input type="image" src="images/login.jpg" alt="Submit Form" />
Late to the conversation...
But, why not use css? That way you can keep the button as a submit type.
html:
<input type="submit" value="go" />
css:
button, input[type="submit"] { background:url(/images/submit.png) no-repeat;" }
Works like a charm.
EDIT: If you want to remove the default button styles, you can use the following css:
button, input[type="submit"]{ color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit; }
from this SO question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With