Bookmark and Share

HTML - Submit Buttons

Submit buttons send form data to a back-end process or application. The back-end process then verifies and precesses the data, eventually passing the information into some database application.

Advertise on Tizag.com

Set the type attribute of the <input> tag to "submit" in order to place a submit button on a web page.

HTML Submit Buttons:

<input type="submit" value="Submit" />
<br /> <input type="submit" value="Send" />
<br /> <input type="submit" value="Submit Form" /><br />

Three HTML Submit Buttons:




Notice that in the above example, we also changed what was written on our button using the value attribute. This can be changed to any value you wish.

HTML - Form Submission - Action

Submission buttons send form data to whatever action has been designated by the action attribute of the encapsulating <form> element. We learned about the action attribute in our HTML Forms lesson.

If you've been following along, we've also been using the deprecated mailto action to send form data to our default email client. This will allow us to get a sense of how form values are transferred to an action.

HTML Code:

<form method="post" action="mailto:youremail@youremail.com" >
First:<input type="text" name="First" size="12" maxlength="12" />
Last:<input type="text" name="Last" size="24" maxlength="24" /> 
<input type="submit" value="Send Email" /> 
</form>

Form Action:


First:
Last:

Fill out the above form, and as your mail program opens, you can change the email address to a personal address and then send the results using the form.

Bookmark and Share




Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials