How to Use Forms in HTML

Learn HTML(4)., Know about the new tags., Start using the placeholder attribute. This provides a placeholder for your box-the text that is displayed until the user clicks on it., Start using the required attribute. This is also good for future...

20 Steps 1 min read Advanced

Step-by-Step Guide

  1. Step 1: Learn HTML(4).

    This forms the basis of HTML5 and you won't understand this article if you do not know HTML4.
  2. Step 2: Know about the new tags.

    The steps outlined below show the new tags description and use. , This was provided by JavaScript, which is now simplified. ,, Instead of using JavaScript to automatically focus the a cursor in the text field, you can just use the autofocus attribute.<input autofocus="" type="text">

    It is well known that almost every site that asks for registration asks for an email address.

    So, use-<input type="email"> You may notice that most browsers do not change anything, but a few hints, like the indication in Opera, or the keyboard-optimization in iPhone. ,,, These also help reduce redundant JavaScript. , Sliders are a much desired UI part of web design, and HTML5 has it. <bor><input min="0" max="10" step="2" type="range"> The same rules as type="number" apply to it. ,, <input type="search"> Mac OS Safari rounds in and gives it native search box styling, which is pretty good.

    But other browser support is a problem, where no other vendor supports this. ,
  3. Step 3: Start using the placeholder attribute.<input placeholder="this is a text box" type="text"> This provides a placeholder for your box-the text that is displayed until the user clicks on it.

  4. Step 4: Start using the required attribute.<input required="" type="text"> This is also good for future proofing as well as validation in select browsers.

  5. Step 5: Start using the autofocus.

  6. Step 6: Start using the email input type.

  7. Step 7: Start using input type "URL" for web addresses.<input type="url">

  8. Step 8: Again you may not see any visible change depending on your browser but this is adhering to standards

  9. Step 9: and future proofing.

  10. Step 10: Use number input type for numbers in a particular range

  11. Step 11: because most of the time numbers are to be in a certain range.<input min="0" max="10" step="2" type="number"> As you may have realized

  12. Step 12: all these are optional(except the type of course); and so do not need to be entered.

  13. Step 13: Start using slider controls.

  14. Step 14: Start using the date and color picker types.<input type="colorpicker"><input type="date"> Sadly

  15. Step 15: Opera is the only browser with major support for these.

  16. Step 16: Start using the search type.

  17. Step 17: Remember that you are free to use any of these

  18. Step 18: right now- all because every browser

  19. Step 19: when it does not understand the type

  20. Step 20: it automatically defaults to<input type="text">

Detailed Guide

This forms the basis of HTML5 and you won't understand this article if you do not know HTML4.

The steps outlined below show the new tags description and use. , This was provided by JavaScript, which is now simplified. ,, Instead of using JavaScript to automatically focus the a cursor in the text field, you can just use the autofocus attribute.<input autofocus="" type="text">

It is well known that almost every site that asks for registration asks for an email address.

So, use-<input type="email"> You may notice that most browsers do not change anything, but a few hints, like the indication in Opera, or the keyboard-optimization in iPhone. ,,, These also help reduce redundant JavaScript. , Sliders are a much desired UI part of web design, and HTML5 has it. <bor><input min="0" max="10" step="2" type="range"> The same rules as type="number" apply to it. ,, <input type="search"> Mac OS Safari rounds in and gives it native search box styling, which is pretty good.

But other browser support is a problem, where no other vendor supports this. ,

About the Author

C

Claire Jordan

Brings years of experience writing about crafts and related subjects.

91 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: