22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 14-12: A text box.<br />

Chapter 14: Working with Forms<br />

Submit and Reset buttons<br />

Submit and Reset buttons help the user tell the browser what to do with the<br />

form. You can create buttons to either submit or reset your form, using the<br />

element with the following type and value attributes:<br />

✓ Submit<br />

Visitors have to tell a browser when they’re done with a form and want<br />

to send the contents. You create a button to submit the form to you by<br />

using the following markup:<br />

<br />

You don’t use the name attribute for the Submit and Reset buttons.<br />

Instead, you use the value attribute to specify how the browser labels<br />

the buttons for display.<br />

✓ Reset<br />

Visitors need to clear the form if they want to start all over again or<br />

decide not to fill it out. You create a button to reset (clear) the form by<br />

using the following markup:<br />

<br />

You can set the value to anything you want to appear on the button. In our<br />

example, we set ours to Clear. Of course, you can use something that’s<br />

more appropriate to your Web site if you’d like.<br />

Listing 14-2 shows an example of markup to create Submit and Reset buttons<br />

named Send and Clear, respectively:<br />

237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!