Interactive HTML5 Form Elements for Effective Data Input
190 likes | 222 Vues
Explore various HTML5 form elements like email, URL, telephone, search boxes, datalist, slider, spinner, and calendar controls. Learn their attributes, examples, and enhance your form usability.
Interactive HTML5 Form Elements for Effective Data Input
E N D
Presentation Transcript
HTML5: Email Text Box • <input> • Accepts text information in e-mail address format • Common Attributes: • type=“email” • name • id • size • maxlength • value • placeholder • required
example • chapter9/email.html
HTML5: URL Text Box • <input> • Accepts text information in URL format • Common Attributes: • type=“url” • name • id • size • maxlength • value • placeholder • required
example • chapter9/url.html
HTML5: Telephone Number Text Box • <input> • Accepts text information in telephone number format • Common Attributes: • type=“tel” • name • id • size • maxlength • value • placeholder • required
example • chapter9/tel.html
HTML5: Search Text Box • <input> • Accepts search terms • Common Attributes: • type=“search” • name • id • size • maxlength • value • placeholder • required
example • chapter9/search.html
HTML5: Datalist Control <label for="color">Favorite Color:</label> <input type="text" name="color" id="color" list="colors" > <datalist id="colors"> <option value="red"> <option value="green"> <option value="blue"> <option value="yellow"> <option value="pink"> <option value="black"> </datalist>
example • chapter9/list.html
HTML5: Slider Control <label for="myChoice"> Choose a number between 1 and 100:</label><br> Low <input type="range" name="myChoice" id="myChoice" min="1" max="100"> High
Example • chapter9/range.html
HTML5: Spinner Control <label for="myChoice">Choose a number between 1 and 10:</label><input type="number" name="myChoice" id="myChoice" min="1" max="10">
example • chapter9/spinner.html
HTML5: Calendar Control <label for="myDate">Choose a Date</label><input type="date" name="myDate" id="myDate">
example • chapter9/date.html
example • chapter9/color.html
Practice with an HTML5 Form • The form display and functioning varies with browser support.
Hands-on practice 9.6 (page 415) • <input type="text" name="myName" id="myName" required="required" placeholder="your first and last name"> • chapter9/form6.html