HTML form with submit button as image

How to submit a form using image as button?
Html Button style.

Explanation

Image button:
Normally we use the submit button to submit a form. But, we can also use any image instead of buttons for the same. This style of buttons can be created using the attribute "type = image".

Example Code:

<form name="hiox" action="index.php" method="POST">
<div align="center"> Name:<input type="text" size="25" name="name"><br>
<input type="image" src="submit.gif" name="image" width="40" height="40">
</div>
</form>

Result:


Name:
Attributes:
This style of buttons can be used along with the following attributes to submit a form.
name - defines an internal name to the button.
type - defines the input type(text,image,etc,.)
src - defines the URL of the image.
width - defines the width of the image.
height - defines the height of the image.
It also supports other attributes like align, vspace, hspace etc.

Ask Questions

Ask Question