Forms and Form Controls

Slides:



Advertisements
Similar presentations
JQuery Mobile. Benefits Required links Remember that we need to add the links to the head, in this order.
Advertisements

Tutorial 6 Creating a Web Form
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
HTML Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
CIS 1310 – HTML & CSS 9 Forms. CIS 1310 – HTML & CSS Learning Outcomes  Describe Common Uses of Forms on Web Pages  Create Forms on Web Pages  Associate.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Forms and Form Controls Chapter What is a Form?
Neal Stublen Improvements  New form elements  Assist with validation  Consistency across sites  Changes reduce the need for common.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
HTML Forms a form is a container for input elements on a web page input elements contain data that is sent to the web server for processing.
User Interface Components Lecture # 5 From: interface-elements.html.
SYST Web Technologies SYST Web Technologies XHTML Forms.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
1 HTML Forms
03 – HTML (2) Informatics Department Parahyangan Catholic University.
Tutorial 6 Creating a Web Form
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Tutorial 6 Working with Web Forms
Creating and Processing Web Forms
Advanced HTML Tags:.
>> Introduction to HTML: Forms
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
How to Write Web Forms By Mimi Opkins.
Objectives Design a form Create a form Create text fields
User Interface Components
CS3220 Web and Internet Programming HTML Tables and Forms
HTML Forms Pat Morin COMP 2405.
FORMS IN HTML.
>> More on HTML Forms
(and available form fields)
ITE 115 Creating Web Page Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Designing Forms Lesson 10.
Introducing Forms.
Objectives Explore web forms Work with form servers
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
Forms, cont’d.
HTML5 Level II Session III
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
New Form Input Types.
CS3220 Web and Internet Programming HTML Tables and Forms
Creating Forms on a Web Page
Web Development Using ASP .NET
Basics of Web Design Chapter 10 Form Basics Key Concepts
Session III Chapter 10 – How to Work with Forms and Data Validation
Presentation transcript:

Forms and Form Controls CIS 136 Building Mobile Apps

Forms JQM forms are enhanced versions of standard HTML controls Form fields comprised of: Text fields Sliders Switches Radio Buttons Checkboxes Selection menus Search inputs

Form Design jQuery mobile enhances form fields so they work better on a mobile device Buttons are automatically widened and heightened easier to click in the small form factor of a phone labels are presented above the form fields buttons will be bigger To disable automatic enhancement of a form field, globally or per object, add data-role=“none” as an attribute in the tag

Forms Must have one <form> tag, and all the tags for the form fields are contained within it The <form> tag must have a method and an action attribute Method says how the transmission is sent (use POST) Action says which program will process the data in the form Each form tag must have a unique "id" attribute The id must be unique across the page views in the app <form method=“post” action=“aServerProgram.php” id=“loginForm”> </form>

Forms The <form> tag must have a method and an action attribute Each form tag must have a unique "id" attribute The id must be unique across the page views in the app Each form fields tag must have a label Use the for attribute of the label to match the id of the element id = “logonForm” >

HTML 5 Form Field types Phones and tablets do not have the benefit most desktops and laptops do a large input device called the "keyboard“, instead, virtual keyboards physically smaller more tedious to operate HTML5 has standardized a handful of input types which make them easier to use on mobile apps Text Email Tel Search Number Date Month Password Toggle Slider

TextBox Standard Syntax: <input type=“text” value="“ id=“someID” name=“someName”> <input type=“email”… Use when you require a user to enter an email address offers a much smoother keyboard experience, displaying the @ and . characters within the initial keypad for quicker typing <label class="item item-input“ for=“emailaddr”> <span class="input-label">Email</span> <input type="email“ value=“” id=“emailaddr” name=“emailaddr”> </label> <label class="item item-input“ for=“loginName”> <span class="input-label">Username</span> <input type="text" value="" id=“loginName name=“loginName> </label>

TextBox <input type=“tel”… <input type=“search”… displays a full numeric keypad makes a great user experience when all that is required from the user is numbers <label class="item item-input“ for=“tel”> <span class="input-label">Telephone</span> <input type="tel“ id=“tel” name=“tel” value=“”> </label> <input type=“search”… changes the button to read “search” and displays a Textbox with a delete icon at the end of the field <label class="item item-input“ for=“srch”> <i class="icon ion-search placeholder-icon"></i> <input type="search" placeholder="Search“ id=“srch” name=“srch”>

TextBox <input type=“number”… <input type=“date”… offers easy access to special characters and symbols <label class="item item-input“ for=“numfield”> <span class="input-label">Number</span> <input type=“number“ id=“numfield” name=“numfield” value=“”> </label> <input type=“date”… should be utilized for when a user is asked to enter the month, day, and year mobile keyboard will offer a nice interactive panel for easy entering <label class="item item-input“ for=“indate”> <span class="input-label">Date</span> <input type=“date“ id=“indate” name=“indate” value=“”>

TextBox <input type=“month”… <input type=“password”… similar to the date input, but leaves out the “day” option perfect example would be for taking credit card expiration dates <label class="item item-input“ for=“amonth”> <span class="input-label">Month</span> <input type=“month“ value=“” id=“amonth” name=“amonth”> </label> <input type=“password”… hides the characters so nobody else can see what the user is typing common practice to give users the option to show actual characters with the text input instead of hidden password characters <label class="item item-input“ for=“apwd”> <span class="input-label">password</span> <input type=“password“ value=“” id=“apwd” name=“apwd”>

TextArea Use <textarea> for multi-line text inputs The text area will automatically grow to fit new lines as text is typed in

Radio Buttons used when a user can select only one of a limited number of choices. use an input with type="radio" and a corresponding label wrap the radio buttons in a <fieldset> element Add a < legend> element to define a caption for the <fieldset> Use data-role="controlgroup", to group the buttons together id=“myForm”>

Checkboxes used when a user can select one or more options of a limited number of choices To group radio buttons or checkboxes horizontally, use the data-type="horizontal" id=“myForm”>

Select Menus (drop down lists) The <select> element creates a drop-down list with several options The <option> elements inside the <select> element define the available options in the list If you have a long list of options that are related, use the <optgroup> element inside <select>

Select Menus mobile platforms have their own way of showing a select menu To have the select menu display the same on all mobile devices, use jQuery's custom select menu using the data- native-menu="false" attribute To select multiple options in the select menu, use the multiple attribute in the <select> element

Select Menus Can groups as well, for vertical or horizontal group of drop down lists <fieldset data-role="controlgroup"> <select>… <select>…. </fieldset>

Form Sliders A slider allows you to select a value from a range of numbers use <input type="range“> max - specifies the maximum value allowed min - specifies the minimum value allowed step - specifies the legal number intervals value - specifies the default value

Sliders to show the value on the slider button, add data-show- value="true“ after “range” To have the value pop up on your screen like a tooltip (as you slide), add data-popup-enabled="true” to highlight the track, up to the slider value, add data- highlight="true“ … > … > … >

Toggle Switch used for on/off or true/false buttons <input type="checkbox data-role="flipswitch“ by default, the text on the flip switch is "On" and "Off“ To change this, use the data-on-text and data-off-text attributes use the "checked" attribute to set one of the options to be pre-selected id=myForm”>

Flip Switch Also used for on/off or true/false buttons use a select control with a data-role set to the value slider <div data-role="fieldcontain"> <label for=“lightbulb">Lightbulb:</label> <select name=“lightbulb" id="lightbulb" data-role="slider"> <option value="0">Off</option> <option value="1">On</option> </select> </div>

Mini fields Form fields in the header or footer may be too large to fit Shrink using data-mini="true" <div data-role="fieldcontain"> <label for=“lightbulb">Lightbulb:</label> <input type=“text” id="lightbulb" value=“” data-mini="true“ /> </div> All form controls accept a data-mini="true" attribute that renders a smaller version of the standard-sized form elements http://demos.jquerymobile.com/1.1.2/docs/forms/forms-all.html

Fieldcontain class To make labels and form elements look correct on wider screens wrap a < div> or <fieldset> element with the "ui-field-contain" class around the label/form element. Or use the data-rolem fieldcontain <div data-role="fieldcontain"> <label for=“story">Your Story:</label> <textarea name=“story" id=“story"></textarea> </div> It styles labels and form controls based upon the width of the page If the width of the page is greater than 480px, it places the label on the same line as the form control If less than 480px, the label will be placed above the form element

Form Design Use a placeholder to specify a short hint that describes the expected value of an input field To hide the label, use the "ui-hidden-accessible" class. This is often used when you want the element's placeholder attribute to serve as the label

Form Design If you want a "clear button" (an X icon on the right side of the input field that clears the contents of the field), add the data-clear-btn="true" attribute Note: The "clear button" can be added on any <input> element, except for <textarea> Search fields have this attribute set to "true" as a default to change it, specify data-clear-btn="false"

Form Buttons Buttons in forms are coded with standard HTML <input> elements (button, reset, submit)

Form Buttons Buttons are automatically styled, but can be additionally styled using the data-* attributes