Download presentation
Presentation is loading. Please wait.
Published byWalter McCormick Modified over 9 years ago
1
HTML Forms – Interactive HTML – Web 2.0
2
HTML – New types for input – Degrades gracefully for browsers that do not support the html 5 input types www.w3schools.com/html/html_forms.asp – Master the basics – For all others use a reference
3
Basics Form http://www.w3schools.com/tags/tag_form.asp http://www.w3schools.com/tags/tag_form.asp – … – A form can contain s such as text fields, checkboxes, radio-buttons, submit buttons – also lists,,,, and s Textbox http://www.w3schools.com/tags/tag_input.asp http://www.w3schools.com/tags/tag_input.asp – – short text input (word.. sentence) single-line input Textarea http://www.w3schools.com/tags/tag_textarea.asp http://www.w3schools.com/tags/tag_textarea.asp – – Can handle multi-line input, paragraph(s), memo
4
attributes Virtually everything needs a (unique) name attribute (there is an exception) – <form name=‘myform’ … – <input name=‘firstname’ … Needed to extract form data Value – <input value=‘initial’ … can be used to specify a default initial value on input elements
5
– type attribute specifies input method <input type=‘text’ renders a normal textbox <input type= ‘password’ renders a password field <input type= ‘radio’ renders a radio button – Use a common name value to group – Selecting one deselects others in the same group (same name) <input type=‘checkbox’ <input type=‘submit’ value=‘submit’ – Defines a submit button – Usually sends form data to server
6
New input types for html 5 – Color – Date – Email – Month – Number – Range – url – Week Unsupported types degrade to normal text fields
7
More Form elements Select (dropdown) list A B C Value attribute indicates what is sent to the server. Selected attribute can be used to set a default
8
Non-Essential Form Elements +
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.