Webmaster

HTML : Fill-In Forms
Contents ]
Jérôme Versavel

Buttons

Buttons are certainly the easiest controls to use in a form.

Let's see how they work:

<BUTTON name="submit" type="submit">OK</BUTTON>

and

<BUTTON name="reset" type="reset"><IMG SRC="my_image.jpg"></BUTTON>

Here is the output produced:





You need to place all the text and images to be displayed between the <BUTTON> and </BUTTON>. The size of the button will automatically adapt itself to suit the content.

The <BUTTON> tag has a TYPE attribute that indicates the action you want to associate with the button. It can take the following values:

  • submit: validates the form and executes the action defined by the ACTION attribute of the <FORM> tag.

  • reset: resets all controls to their initial default values.

  • button: no particular action is associated with the button.

  • The button can reference a particular JavaScript function through the onClick attribute.



  1   2   3   4   5   6