From the course: HTML and CSS: Creating Forms
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Buttons
- [Instructor] Every form needs a submit button. There are two main ways to create buttons on forms using the submit input type or the button element. The button element is generally preferred because it's more flexible as far as being able to style it. But we'll start with the more basic submit input type. We already added a submit button in an earlier video using input with a type=submit. If you don't specify, the browser will use the default button text, which can vary. For example, you see here it's Submit Query in Firefox. In Safari, it's submit. If you want different button text, you can add a value attribute. You can only add plain text here, so there isn't much flexibility. So for an order form, I might want the button to say Place Order. So I would just go to the input element, value="Place Order" and save and refresh in the browser. Now I have the new button text. You can use other words as appropriate, but make sure it's clear to the user what will happen when they click…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Basic form structure4m 11s
-
(Locked)
Name, id, and label5m 24s
-
(Locked)
Email and URL input types5m 1s
-
(Locked)
Number and tel input types6m 7s
-
(Locked)
Date and time input types4m 34s
-
(Locked)
Radio buttons and checkboxes5m 54s
-
(Locked)
Select element5m 47s
-
(Locked)
Textarea element2m 38s
-
(Locked)
Other input types4m 54s
-
(Locked)
Buttons3m 27s
-
(Locked)
Placeholder attribute2m 54s
-
(Locked)
Other form attributes3m 57s
-
(Locked)
-
-
-
-