SlideShare a Scribd company logo
1 of 13
HTML Forms, Input and Drop
Down Menus
HTML Forms
   HTML Forms are used to select different kinds of user
    input.
   HTML forms are used to pass data to a server.
   A form can contain input elements like text fields,
    checkboxes, radio-buttons, submit buttons and more.
    A form can also contain select lists, textarea, fieldset,
    legend, and label elements.
   The <form> tag is used to create an HTML form:
   <form>
    input elements
    </form>
 The most important form element is the input
  element.
 The input element is used to select user
  information.
 An input element can vary in many ways,
  depending on the type attribute. An input
  element can be of type text field, checkbox,
  password, radio button, submit button, and
  more.
 The most used input types are described AS
  follows…….
 <input type="text" /> defines a one-line input
  field that a user can enter text into:
 <form>
  First name: <input type="text"
  name="firstname" /><br />
  Last name: <input type="text" name="lastname"
  />
  </form>
 How the HTML code above looks in a browser:
 Note: The form itself is not visible. Also note
  that the default width of a text field is 20
  characters.
 <form>
 <input type=“number" />
 </form>

 <form>
 <input type=“date" />
 </form>
   <input type="password" /> defines a
    password field:
   <form>
    Password: <input type="password"
    name="pwd" />
    </form>
   How the HTML code above looks in a
    browser:
   Note: The characters in a password field are
    masked (shown as asterisks or circles).
   <input type="radio" /> defines a radio button.
    Radio buttons let a user select ONLY ONE of a
    limited number of choices:
   <form>
    <input type="radio" name="sex" value="male" />
    Male<br />
    <input type="radio" name="sex" value="female"
    /> Female
    </form>
   How the HTML code above looks in a browser:
   <input type="checkbox" /> defines a checkbox.
    Checkboxes let a user select ZERO or MORE
    options of a limited number of choices.
   <form>
    <input type="checkbox" name="vehicle"
    value="Bike" /> I have a bike<br />
    <input type="checkbox" name="vehicle"
    value="Car" /> I have a car
    </form>
   How the HTML code above looks in a browser:
 <input type="submit" /> defines a submit button.
 A submit button is used to send form data to a server. The
  data is sent to the page specified in the form's action
  attribute. The file defined in the action attribute usually
  does something with the received input:
 <form name="input" action="html_form_action.asp"
  method="get">
  Username: <input type="text" name="user" />
  <input type="submit" value="Submit" />
  </form>
 How the HTML code above looks in a browser:
 If you type some characters in the text field above, and
  click the "Submit" button, the browser will send your input
  to a page called "html_form_action.asp". The page will
  show you the received input.
Drop-down menus are probably the most flexible objects you can add to your
forms.

Depending on your settings, drop-down menus can serve the same purpose
as radio buttons (one selection only) or check boxes (multiple selections
allowed).

The advantage of a drop-down menu, compared to radio buttons or check
boxes, is that it takes up less space.
But that is also a disadvantage, because people can't see all options in the
menu right away.

There is a workaround for this - with the size setting, you can customize the
menu so it shows more than just one option at a time, but when you do that -
you also lose the advantage of taking up less space.
 The <select> tag defines the menu.
  <select>
   <option>Milk</option>
   <option>Coffee</option>
   <option>Tea</option>
  </select>
 The name setting adds an internal name to the field so the
  program that handles the form can identify the fields.
 The size option defines how many items should be visible at
  a time. Default is one item.
 The multiple setting will allow for multiple selections if
  present.
   The <option> tag defines the single items in the
    menu.
   <option value="ID">Idaho</option>
 The value setting defines what will be submitted
  if the item is selected. This is not always the
  same as what it says in the menu. If our field was
  defined this way:
 then, in the menu it would say "Idaho" but when
  the form was submitted the abbreviated "ID"
  would actually be sent.
   AN EXAMPLE:
    Look at this HTML example:
    <html>
    <head>
    <title>My Page</title>
    </head>
    <body>
    <form name="myform"
    action="http://www.mydomain.com/myformhandler.cgi" method="POST">
    <div align="center">
    <select name="mydropdown">
    <option value="Milk">Fresh Milk</option>
    <option value="Cheese">Old Cheese</option>
    <option value="Bread">Hot Bread</option>
    </select>
    </div>
    </form>
    </body>
    </html>

More Related Content

What's hot (20)

HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Entering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML FormsEntering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML Forms
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
 
Html forms
Html formsHtml forms
Html forms
 
New Form Element in HTML5
New Form Element in HTML5New Form Element in HTML5
New Form Element in HTML5
 
Html forms
Html formsHtml forms
Html forms
 
Html forms
Html formsHtml forms
Html forms
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
Form using html and java script validation
Form using html and java script validationForm using html and java script validation
Form using html and java script validation
 
Forms
FormsForms
Forms
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
 
Html forms
Html formsHtml forms
Html forms
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML forms
 
Web Development 5
Web Development 5 Web Development 5
Web Development 5
 
Html form
Html formHtml form
Html form
 
Higher - HTML forms
Higher - HTML formsHigher - HTML forms
Higher - HTML forms
 
PHP Making Web Forms
PHP Making Web FormsPHP Making Web Forms
PHP Making Web Forms
 
Php forms
Php formsPhp forms
Php forms
 
PHP - Introduction to PHP Forms
PHP - Introduction to PHP FormsPHP - Introduction to PHP Forms
PHP - Introduction to PHP Forms
 

Similar to Designing web pages html forms and input (20)

Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html forms
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
html forms
html formshtml forms
html forms
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
HTML FORMS.pptx
HTML FORMS.pptxHTML FORMS.pptx
HTML FORMS.pptx
 
HTML
HTML HTML
HTML
 
Html 4
Html   4Html   4
Html 4
 
Html 4
Html   4Html   4
Html 4
 
Html basics 10 form
Html basics 10 formHtml basics 10 form
Html basics 10 form
 
Html class-04
Html class-04Html class-04
Html class-04
 
Lectures-web
Lectures-webLectures-web
Lectures-web
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
 
HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Handout7 html forms
Handout7 html formsHandout7 html forms
Handout7 html forms
 
20-html-forms.ppt
20-html-forms.ppt20-html-forms.ppt
20-html-forms.ppt
 
11-html-forms.ppt
11-html-forms.ppt11-html-forms.ppt
11-html-forms.ppt
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 

More from Jesus Obenita Jr.

More from Jesus Obenita Jr. (20)

Organization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management TheoryOrganization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management Theory
 
Organization and management 2 Management Function
Organization and management 2 Management FunctionOrganization and management 2 Management Function
Organization and management 2 Management Function
 
Organization and management 1
Organization and management 1Organization and management 1
Organization and management 1
 
Designing web page marquee and img tag
Designing web page  marquee and img tagDesigning web page  marquee and img tag
Designing web page marquee and img tag
 
Ms excel 2013 formatting worksheets
Ms excel 2013 formatting worksheetsMs excel 2013 formatting worksheets
Ms excel 2013 formatting worksheets
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data management
 
Microsoft Excel introduction
Microsoft Excel introductionMicrosoft Excel introduction
Microsoft Excel introduction
 
Word 2013 working with pictures
Word 2013 working with picturesWord 2013 working with pictures
Word 2013 working with pictures
 
Word 2013 Formatting Page
Word 2013 Formatting PageWord 2013 Formatting Page
Word 2013 Formatting Page
 
Word 2013 8
Word 2013 8Word 2013 8
Word 2013 8
 
Ms word 2013 7
Ms word 2013 7Ms word 2013 7
Ms word 2013 7
 
Ms word 2013 6
Ms word 2013 6Ms word 2013 6
Ms word 2013 6
 
Ms word 2013 4
Ms word 2013 4Ms word 2013 4
Ms word 2013 4
 
Ms word 2013 2
Ms word 2013 2Ms word 2013 2
Ms word 2013 2
 
Ms word 2013
Ms word 2013Ms word 2013
Ms word 2013
 
Parts of the ms word 2013 screen and
Parts of the ms word 2013 screen andParts of the ms word 2013 screen and
Parts of the ms word 2013 screen and
 
Word processor
Word processorWord processor
Word processor
 
Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
 
Cooking ingredients
Cooking ingredientsCooking ingredients
Cooking ingredients
 
Color theory
Color theoryColor theory
Color theory
 

Recently uploaded

Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 

Recently uploaded (20)

Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 

Designing web pages html forms and input

  • 1. HTML Forms, Input and Drop Down Menus
  • 2. HTML Forms  HTML Forms are used to select different kinds of user input.  HTML forms are used to pass data to a server.  A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select lists, textarea, fieldset, legend, and label elements.  The <form> tag is used to create an HTML form:  <form> input elements </form>
  • 3.  The most important form element is the input element.  The input element is used to select user information.  An input element can vary in many ways, depending on the type attribute. An input element can be of type text field, checkbox, password, radio button, submit button, and more.  The most used input types are described AS follows…….
  • 4.  <input type="text" /> defines a one-line input field that a user can enter text into:  <form> First name: <input type="text" name="firstname" /><br /> Last name: <input type="text" name="lastname" /> </form>  How the HTML code above looks in a browser:  Note: The form itself is not visible. Also note that the default width of a text field is 20 characters.
  • 5.  <form> <input type=“number" /> </form>  <form> <input type=“date" /> </form>
  • 6. <input type="password" /> defines a password field:  <form> Password: <input type="password" name="pwd" /> </form>  How the HTML code above looks in a browser:  Note: The characters in a password field are masked (shown as asterisks or circles).
  • 7. <input type="radio" /> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices:  <form> <input type="radio" name="sex" value="male" /> Male<br /> <input type="radio" name="sex" value="female" /> Female </form>  How the HTML code above looks in a browser:
  • 8. <input type="checkbox" /> defines a checkbox. Checkboxes let a user select ZERO or MORE options of a limited number of choices.  <form> <input type="checkbox" name="vehicle" value="Bike" /> I have a bike<br /> <input type="checkbox" name="vehicle" value="Car" /> I have a car </form>  How the HTML code above looks in a browser:
  • 9.  <input type="submit" /> defines a submit button.  A submit button is used to send form data to a server. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input:  <form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form>  How the HTML code above looks in a browser:  If you type some characters in the text field above, and click the "Submit" button, the browser will send your input to a page called "html_form_action.asp". The page will show you the received input.
  • 10. Drop-down menus are probably the most flexible objects you can add to your forms. Depending on your settings, drop-down menus can serve the same purpose as radio buttons (one selection only) or check boxes (multiple selections allowed). The advantage of a drop-down menu, compared to radio buttons or check boxes, is that it takes up less space. But that is also a disadvantage, because people can't see all options in the menu right away. There is a workaround for this - with the size setting, you can customize the menu so it shows more than just one option at a time, but when you do that - you also lose the advantage of taking up less space.
  • 11.  The <select> tag defines the menu. <select> <option>Milk</option> <option>Coffee</option> <option>Tea</option> </select>  The name setting adds an internal name to the field so the program that handles the form can identify the fields.  The size option defines how many items should be visible at a time. Default is one item.  The multiple setting will allow for multiple selections if present.
  • 12. The <option> tag defines the single items in the menu.  <option value="ID">Idaho</option>  The value setting defines what will be submitted if the item is selected. This is not always the same as what it says in the menu. If our field was defined this way:  then, in the menu it would say "Idaho" but when the form was submitted the abbreviated "ID" would actually be sent.
  • 13. AN EXAMPLE: Look at this HTML example: <html> <head> <title>My Page</title> </head> <body> <form name="myform" action="http://www.mydomain.com/myformhandler.cgi" method="POST"> <div align="center"> <select name="mydropdown"> <option value="Milk">Fresh Milk</option> <option value="Cheese">Old Cheese</option> <option value="Bread">Hot Bread</option> </select> </div> </form> </body> </html>