How can I use an image as the submit or reset button?

Source: Internet
Author: User

1. submit:

Use Image instead of submit button:

When there is only one commit button, it can be implemented simply without adding an event function.

IMG/yi022_r3_c11.gif is your image address, and style is the image style.

Code: <input type = "image" name = "login" src = "img/yi022_r3_c11.gif" style = "width: 77; Height: 25; align: absmiddle"/>

Replace all form submission buttons with images:

The format of the Image Code that replaces the submit button is
<Input type = "image" name = "..." src = "..." onclick = "document. formname. Submit ()">
Note: The formname here is the name attribute value of the form.

2. Reset:

Replace the reset button with an image:
Code: <input type = "image" src = "images/chong.gif" onclick = "reset" width = "54" Height = "17">

Replace all form reset buttons with images

The format of the Code image that replaces the reset button is
<A href = "javascript: Document. formname. Reset ();"> </a>

Note: The formname here is the name attribute value of the form.

3. Change the style of the submit box:

Style: Style = "width: 80px; Height: 20px; Border: 1px solid # fbaf0c ;"

Application: <input name = "name" type = "text" id = "name" size = "10" onmouseover = "this. select () "style =" width: 80px; Height: 20px; Border: 1px solid # fbaf0c; "/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.