Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Creating a Custom Submit Button

You can combine forms with all the HTML bells and whistles you learn about in this book, including backgrounds, graphics, text colors, tables, and frames. When you do so, however, the standard Submit and Reset buttons may start looking a little bland.

Fortunately, there is an easy way to substitute your own graphics for those buttons. Type the following to use an image of your choice for a Submit button:

<input type="image" src="button.gif" />

The image named button.gif will appear on the page, and the form will be submitted whenever someone clicks that image. You can also include any attributes normally used with the <img /> tag, such as border or align. (Hour 10, "Putting Graphics on a Web Page," introduces the <img /> tag.)

Figures 8.5 and 8.6 show a very simple form that uses a customized submit button. (You'll see how to make graphics like the signup.gif button in Hour 9, "Creating Your Own Web Page Graphics." )

08fig05.gif

Figure 8.5 The <input /> tag on this page uses a custom graphical submit button.

Share ThisShare This

Informit Network