Rolf Rolf - 1 month ago 8
HTML Question

How do I use an image as a submit button?

Can someone help to change this to incorporate an image called

BUTTON1.JPG
instead of the standard
submit
button?

<form id='formName' name='formName' onsubmit='redirect();return false;'>
<div class="style7">
<input type='text' id='userInput' name='userInput' value=''>
<input type='submit' name='submit' value='Submit'>
</div>
</form>

Answer

Use an image type input:

<input type="image" src="/Button1.jpg" border="0" alt="Submit" />

The full HTML:

<form id='formName' name='formName' onsubmit='redirect();return false;'>
    <div class="style7">
        <input type='text' id='userInput' name='userInput' value=''>
        <input type="image" name="submit" src="/Button1.jpg" border="0" alt="Submit" />
    </div>
</form> 
Comments