Checkboxes, Select boxes, Radio buttons,

Slides:



Advertisements
Similar presentations
Modifying existing content Adding/Removing content on a page using jQuery.
Advertisements

2-May-15 GUI Design. 2 HMI design There are entire college courses taught on HMI (Human-Machine Interface) design This is just a very brief presentation.
Video, audio, embed, iframe, HTML Form
16/19/2015CS120 The Information Era CS120 The Information Era Chapter 5 – Advanced HTML TOPICS: Introduction to Web Page Forms and Introductory Javascript.
Personal Independent Networking Project HTML Forms by Chris Smith.
Other types of input element There are some types of input element that we have not considered: –type='image’ –type='hidden’ We will delay dealing with.
There is a certain way that an HTML file should be set up. The HTML section declares a beginning and an ending. Within the HTML, there should be a HEAD.
June is an easy way to communicate. It costs nothing to send an , but it does require a connection to the Internet. You can.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
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.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
1 VU. 2 CS101 Introduction to Computing Lecture 15 More on Interactive Forms (Web Development Lecture 5)
Forms Sangeetha Parthasarathy 02/05/2001. Introduction to Forms A form makes it possible to transform your web pages from text to graphics to interactive.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
JavaScript. During the last lecture We looked at the utility of forms on Web pages We found out about the various components that are used in a form We.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Introduction to HTML Part 3 Chapter 2. Learning Outcomes Identify how to design frames. Explain frames’ attributes. Describe the method on designing forms.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
FORMS. Forms are used to receive information from the web surfer, such as: their name, address, credit card, etc. Form fields are objects that allow.
NYS Division of Homeland Security And Emergency Services (DHSES) E-Grants Tutorial Creating an Application for the EOC RFP To access DHSES E-Grants you.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Modifying HTML attributes and CSS values. Learning Objectives By the end of this lecture, you should be able to: – Select based on a class (as opposed.
SYST Web Technologies SYST Web Technologies XHTML Forms.
Photoshop Image Slicing. Reasons to Image Slide To create links out of sliced images To optimise different areas. (flat areas of colour, such as logos,
Web Page Design Forms! Website Design. Objectives What forms can do The Attributes of the form tag Using Textboxes Textareas Checkboxes Radio buttons.
+ 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.
Radio Buttons.  Quiz  Radio Buttons  Check boxes 2.
Review of HTML and CSS A (very) brief review of some key fundamentals to be aware of in IT-238.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
Check Boxes. 2 Check boxes  Image from:  HTML:  Each box gets it's own.
SurveyDIG 2.1 Tutorial. Tutorial Contents Introduction Introduction Item Groups Item Groups –Creating new Groups –Naming Convention –Searching/Editing.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
How To Make Easysite Forms By Joshua Crawley Contact:
Creating and Processing Web Forms
Advanced HTML Tags:.
Web Forms.
SurveyDIG 2.1 Tutorial.
Intro to Dynamic HTML Intro to Forms
Making your HTML Page Interactive
Web Forms.
Objectives Design a form Create a form Create text fields
HTML Forms Pat Morin COMP 2405.
Collecting Information from the User
FORMS IN HTML.
(and available form fields)
HTML Forms CSC 102 Lecture.
CS 0134 (term 2181) Jarrett Billingsley
Retrieving information from forms
Section 10.1 YOU WILL LEARN TO… Define scripting
HTML Forms and User Input
Introduction to Access 2003
Creating Forms on a Web Page
GUI Design 24-Feb-19.
© Hugh McCabe 2000 Web Authoring Lecture 8
Working with ‘checked’ items Checkboxes and Radio buttons
Lesson 6: Web Forms.
PHP-II.
Web Forms.
Making your HTML Page Interactive
JavaScript Part 2 Organizing JavaScript Code into Functions
Retrieving information from forms
Checkboxes, Select boxes, Radio buttons
The W3C More on images Entity codes Remote vs Local Computers
Presentation transcript:

Checkboxes, Select boxes, Radio buttons, Intro to Forms, Part 2 Checkboxes, Select boxes, Radio buttons,

Learning Objectives By the end of this lecture, you should be able to: Create a checkbox, select box, and radio button Explain the basic difference between the value attribute in a select option, and the value that goes between the option tags Explain the reason why a given group of radio buttons need to share the same name Discuss the concept of clarity as it applies to naming your form elements

Forms: Checkboxes When you want to give the user multiple selections, use a checkbox. If you want to limit the user to ONE selection, use a radio button. Clicking in the box places a checkmark inside. Notice that unlike with buttons, the value attribute has NO bearing on the appearance of the box. The value of ‘value’ becomes important when it is passed to a script. More on this later.

Forms: Checkboxes contd Who are your favorite composers? <br> Beethoven: <input type="checkbox" id="chkBeethoven" > <br> Bach: <input type="checkbox" id="chkBach" > <br> Mozart: <input type="checkbox" id="chkMozart" > <br> Brahms: <input type="checkbox" id="chkBrahms" > <br> Stravinsky: <input type="checkbox" id="chkStrav" > <br>

Forms: Checkboxes contd Do you agree to these terms? <br> I agree: <input type="checkbox" id="chkAgree" > I disagree: <input type="checkbox" id="chkDisagree"> Pop-Quiz: Why is the checkbox a poor choice here? Answer: Because the user could check both buttons. A better choice would be a radio button.

The ‘checked’ attribute Do you agree to these terms? <br> I agree: <input type="checkbox" id="chkAgree" checked="checked" > <br> Note the ‘checked’ attribute. This places a check in the box automatically when the page is first displayed. The checked attribute can be used with checkboxes and radio buttons.

An aside: Note the fairly sloppy appearance of each line. Any good page designer will put some thought into giving their forms a neat appearance. We will discuss how to position items on a page using CSS towards the end of the course.

Forms: Select Box Similar to radio buttons, except that the options are hidden until the user clicks. Once the user has chosen, the options are re-hidden. Useful for situations where you have many possible options to choose from. (E.g. “What year were you born?”) While you can easily hide 100+ years inside a select box, you could not do so with a radio button!

Forms: Select Does not use the ‘input’ tag. Instead, uses ‘select’. Yields a drop-down box from which the user can choose from a list of options. Each item in the menu is created using the <option> tag. Important: Be sure that you do not confuse the value inside the option tags, with the prompt (which is what your viewers see) which is between the ‘option’ tags. What month were you born? <br> <select id="selMonthBorn"> <option value="jan">January</option> <option value="feb">Febuary</option> <option value="mar">March</option> </select>

Select Box: value vs option As mentioned previously, be sure not to confuse the value inside the option tags, with the prompt (which is what your viewers see) which is between the option tags. What year were you born? <br> <select id="selYearBorn"> <option value="53">1953</option> <option value="54">1954</option> <option value="55">1955</option> </select>

Select Box: value vs option That being said, there is no reason why they can’t be the same. Here is an example: What year were you born? <br> <select id="selYearBorn"> <option value="1953">1953</option> <option value="1954">1954</option> <option value="1955">1955</option> </select>

An IMPORTANT Aside! selMB selMonth selQ23B4 selMonthBorn We have discussed the concept of ‘clarity’ on a few occasions throughout the course so far. In addition to how your code "looks", the concept of clarity also applies to things like names that you choose for your form elements. Pop-Quiz: Suppose you had a select box in which you asked the user what month they were born in. Which of the following identifiers do YOU think is the best choice? selMB selMonth selQ23B4 selMonthBorn Answer: I hope you can agree that selMonthBorn is a much easier name to understand when looking at someone's code.

Forms: Radio Buttons We use radio buttons when we want to the user to be able to select only one of the options. Checking one selection automatically deselects any other. To do this, we add an attribute called ‘name’. All buttons in a given group must have the same name. Rate this movie from 1 to 5 stars:<br> 1 stars : <input type="radio" id= "radOne" name="movieRating"><br> 2 stars: <input type="radio" id= "radTwo" name="movieRating"><br> 3 stars: <input type="radio" id= "radThree" name="movieRating"><br> 4 stars: <input type="radio" id= "radFour" name="movieRating"><br> 5 stars: <input type="radio" id= "radFive" name="movieRating"><br> By adding the attribute called ‘name’ and giving this attribute the same name for all of the buttons, they are grouped and the user will only be able to select ONE out of the whole group.

Forms: Radio Buttons contd Again, use radio buttons when you want the user to be limited to only one possible choice: Who is your favorite composer? <br> Beethoven: <input type="radio" id= "radBeethoven" name="favComposer"> <br> Bach: <input type="radio" id= "radBach" name="favComposer""><br> Mozart: <input type="radio" id= "radMozart" name="favComposer"> <br> Brahms: <input type="radio" id= "radBrahms" name="favComposer"> <br> Stravinsky: <input type="radio" id= "radStravinsky" name="favComposer"> <br> And again, recall how for a group of radio buttons, we have included a ‘name’ attribute. As discussed, this groups the buttons and thereby limits the user to selecting only one item out of that group.

<input type="file" id="fileAttach"> Forms: File Shows a textbox and a Browse button that allows the user to select a file from their computer. E.g. Used to choose a file to attach to an e-mail message. We will not be using this control in this course. <input type="file" id="fileAttach">

Forms: Keep ‘em neat Unfortunately, this apparently simple task requires some challenging CSS We will discuss “layout and positioning” later in the course

Quick ‘n dirty way to line things up There is a character entity called the “non-breaking space”:   This entity allows you to add multiple spaces and can therefore force content to be pushed over to the right. This technique is a bit of a cheat, but in the short term, it’s a way to at least try and exert some control over the layout of your pages. (Example on next slide) Do NOT spend a lot of time using this entity to line things up. In the “real world” using the non-breaking space is not considered a proper solution for positioning items on a page. We will have a talk on how to use CSS for layout and positioning at the end of the course.

Example using   First Name: TEXT BOX  5 spaces before the text box Middle Initial: TEXT BOX  2 spaces before the text box Last Name: TEXT BOX  6 spaces before the text box Code: First Name:     <input type="text.... Middle Initial:  <input type="text.... Last Name:      <input type="text... Again, please note that this is NOT an ideal solution. I’ve only discussed it here to help if a small amount of space somewhere is driving you nuts – it happens! The proper solution is to use CSS layout and positioning techniques. We will not cover CSS positioning until the end of the course, however, you are certainly free to read up on it in advance and apply it to your pages!

Example: form_with_select_radio.htm Pop-Quiz: For the month born, I could have used either a select box or a radio button. Both would "work" just as well. Why do you think I decided to use a select box? Answer: Having all 12 months as radio buttons would take up a lot of real-estate on the web page. It would add unnecessary clutter. As a more extreme example, imagine if I was asking about the birth year with over 100 options!