SlideShare a Scribd company logo
1 of 17
Fundamentals of Web designing
Ministry of Higher Education
Bamyan University
Computer Science Department
1
Presented by : Mustafa Kamel Mohammadi
Email : bamian.cs@gmail.com
Working forms in HTML
learning objective
 In this chapter you will learn
 How to create forms in HTML
2
HTML forms
 Forms are used frequently in many applications
 Login
 Adding records to system
 ….
 Form are consists of two parts
 Form interface designed by HTML and CSS
 Form action file that process form requests
 Forms are created in HTML using <form> </form>
 “action” attribute of <form> identifies the processing file by its URL
 “method” attribute of <form> identifies the method of passing data from
interface to processing file
 Two methods are frequent in passing data “GET”, “POST”
3
HTML form passing data
 GET
 Passes data to processing page by URL
 Used when transferring small amount of data from interface to processing part
 Used when needed to remember the browsing history
 POST
 Passes data to processing part by encapsulating data in a message package
 Used for transferring large amount of data and so small
 Data passed through POST method is not rememberable
4
From controls
 forms are made of some form elements called form controls like
 Text fields
 Password fields
 Checkboxes
 Radio buttons
 Lists or menus
 Buttons
 Almost all form controls has attribute “name” which contains the name of form
control element set by us.
 We use this “name” attribute to get the value of element in processing page.
5
Text fields
 Used to enter data like name, zipcode, numbers, ….
 Can get single line numeric and text data
 <input /> with “type” attribute set to “text” create text field
 It has some attribute like
 Size : determines the length of text box in character
 Maxlenght : specifies the maximum characters that we can type in text field
 Value : specifies the default value typed in text field
<input type=“text” name=“first_name” size=“20” value=“type first name here” />
6
Password field
 Used to enter password data into the text box
 It shows the (* ) in place of character typed in box
 <input /> with “type” attribute set to “password” create password field
 It has the same attributes as “text field” like “size”, “maxlenght”
 It has no security policy for encrypting data
<input type=“password” name=“user_pass” size=“20” />
7
Textarea
 Is a large , multiline, scrollable text box
 <textarea> </textarea> creates a text are box, “name” attr is a must.
 “cols” and “rows” attributes specifies the width a height of text box
<textarea name=“comment” col=“20” rows=“40” >
</textarea>
8
Check box
 act as a multiple choice form input
 <input /> with “type” attribute set to “checkbox” create chechbox
 Because it allows multiple choice options so
 Create all check boxes related to a single group with adding an attribute “name” to it.
 Add “value” attribute to each of them and set the value.
 If you want to set some options to be checked add attribute “Checked” with the
value “checked”
<input type=”checkbox” name=”fav_flavor” value=”chocolate”
checked=”checked” />
9
Radio buttons
 a single choice form input
 <input /> with “type” attribute set to “radio” create radio buttons.
 The same as checkboxes , but in a radio button group you can only choose one
option rather than multiple options in check boxes
 If you want to set one option to be checked add attribute “Checked” with the
value “checked”
<input type=”radio” name=”hand” value=”right”
checked=”checked” />
10
Selection menu
 allows user to select one from multiple options through a menu
 Creating menu is the same as lists but their tags differs
 Each option has a vlue attribute , this is the value that is sent when form is
submitted.
<select name=“country”>
<option value=“af”>Afghanistan</option>
<option value=“ir”>Iran</option>
<option value=“pk”>Pakistan</option>
<option value=“us”>United states</option>
</select>
11
Cont.
 “size” attribute of <select> takes a numeric value, signifying the number of list
options you want to make visible
 To permit users to make multiple selections from the list, add a multiple attribute
and set it equal to multiple.
 To specify one option as preselected, define a selected attribute for the <option>
tag and set it equal to selected.
<select name=”pets” size=”4” multiple=”multiple”>
<option value=”k9” selected=”selected”>Dogs</option>
…
</select>
12
File fields
 HTML allows you to select files from PC
 <input /> with “type” attribute set to “file” create file fields
 Set “name” attribute to specify uniquely a form control
 To limit the type of files a visitor can upload, define an accept attribute and set it
equal to the MIME type of the files you want to allow.
 MIME stands for Multi-purpose Internet Mail Extensions
<input type=”file” name=”profile_image” size=”20” maxlength=”50”
accept=”image/gif”>
13
Submit or Reset form
 Site visitors click buttons either to send the completed form to the server (the
Submit button) or to clear the form if they’ve made a mistake (the Reset but-ton)
 To create a Submit or reset button, insert an <input>tag add a “type” attribute
and set it equal to submit or reset.
<input type=”submit” value=”Submit” name=”submit” />
<input type=”reset” value=”Reset” name=”reset” />
14
Hidden fields
 HTML provides a mechanism by which you can include values in your form to be
sent to the script that visitors never see. These values are defined using hidden
fields.
 Insert an <input>tag define a “type” attribute and set it equal to hidden
 <input type=”hidden” name=”form_num” value=”C0003435” />
15
16
References
• “HTML 4 dummies 5th edition” by Ed Tittel & Mary Burmeister
• “HTML 5 designing rich internet applications” by Mathew Dawid
• “HTML in ten simple steps” by Robert G. fuller
17

More Related Content

What's hot (20)

2. html attributes
2. html attributes2. html attributes
2. html attributes
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
 
Css ppt
Css pptCss ppt
Css ppt
 
HTML5
HTML5HTML5
HTML5
 
html-table
html-tablehtml-table
html-table
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html forms
Html formsHtml forms
Html forms
 
Html links
Html linksHtml links
Html links
 
html tags
html tagshtml tags
html tags
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Html forms
Html formsHtml forms
Html forms
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 

Viewers also liked

How to take control of your l ife
How to take control of your l ifeHow to take control of your l ife
How to take control of your l ifeMashooq Jami
 
How to speak in public
How to speak in publicHow to speak in public
How to speak in publicJawid Qaumi
 
Tarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfTarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfBU
 
Bitcharities Cause Presentation
Bitcharities Cause PresentationBitcharities Cause Presentation
Bitcharities Cause PresentationFrancesco Rulli
 
Introduction to graph databases in term of neo4j
Introduction to graph databases in term of neo4jIntroduction to graph databases in term of neo4j
Introduction to graph databases in term of neo4jAbdullah Hamidi
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Hassen Poreya
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and AwarenessAbdul Rahman Sherzad
 
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraFondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraAlessandro Califano, PhD
 
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanEnterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanFarshid Ghyasi
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Markus Eisele
 
Monitoring Virtualized Environments
Monitoring Virtualized EnvironmentsMonitoring Virtualized Environments
Monitoring Virtualized EnvironmentsAhmad Khalid Nasrat
 

Viewers also liked (20)

How to take control of your l ife
How to take control of your l ifeHow to take control of your l ife
How to take control of your l ife
 
Lecture 1. java database connectivity
Lecture 1. java database connectivityLecture 1. java database connectivity
Lecture 1. java database connectivity
 
How to speak in public
How to speak in publicHow to speak in public
How to speak in public
 
Simple past
Simple pastSimple past
Simple past
 
E learning ict4-d_presentation
E learning ict4-d_presentationE learning ict4-d_presentation
E learning ict4-d_presentation
 
MyCV
MyCVMyCV
MyCV
 
Tarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfTarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdf
 
Bitcharities Cause Presentation
Bitcharities Cause PresentationBitcharities Cause Presentation
Bitcharities Cause Presentation
 
Introduction to sql_02
Introduction to sql_02Introduction to sql_02
Introduction to sql_02
 
Introduction to graph databases in term of neo4j
Introduction to graph databases in term of neo4jIntroduction to graph databases in term of neo4j
Introduction to graph databases in term of neo4j
 
Computational Advertising
Computational AdvertisingComputational Advertising
Computational Advertising
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and Awareness
 
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraFondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
 
Google Search Console
Google Search ConsoleGoogle Search Console
Google Search Console
 
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanEnterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Mite Nroc Beebe Aeqa
Mite Nroc Beebe AeqaMite Nroc Beebe Aeqa
Mite Nroc Beebe Aeqa
 
Bootstrap day3
Bootstrap day3Bootstrap day3
Bootstrap day3
 
Monitoring Virtualized Environments
Monitoring Virtualized EnvironmentsMonitoring Virtualized Environments
Monitoring Virtualized Environments
 

Similar to Web design - Working with forms in HTML (20)

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
 
Designing web pages html forms and input
Designing web pages html  forms and inputDesigning web pages html  forms and input
Designing web pages html forms and input
 
20 html-forms
20 html-forms20 html-forms
20 html-forms
 
05 html-forms
05 html-forms05 html-forms
05 html-forms
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
HTML
HTML HTML
HTML
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html forms
 
Html class-04
Html class-04Html class-04
Html class-04
 
Html forms
Html formsHtml forms
Html forms
 
Html forms
Html formsHtml forms
Html forms
 
Cmsc 100 (web forms)
Cmsc 100 (web forms)Cmsc 100 (web forms)
Cmsc 100 (web forms)
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
Html form
Html formHtml form
Html form
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
HTML Foundations, pt 3: Forms
HTML Foundations, pt 3: FormsHTML Foundations, pt 3: Forms
HTML Foundations, pt 3: Forms
 
HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4
 
Chapter09
Chapter09Chapter09
Chapter09
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 

More from Mustafa Kamel Mohammadi

Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTMLMustafa Kamel Mohammadi
 
Web design - Working with Links and Images
Web design - Working with Links and ImagesWeb design - Working with Links and Images
Web design - Working with Links and ImagesMustafa Kamel Mohammadi
 
Web design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTMLWeb design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTMLMustafa Kamel Mohammadi
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionMustafa Kamel Mohammadi
 
Web design - Applications and web application definition
Web design - Applications and web application definitionWeb design - Applications and web application definition
Web design - Applications and web application definitionMustafa Kamel Mohammadi
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...Mustafa Kamel Mohammadi
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...Mustafa Kamel Mohammadi
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureMustafa Kamel Mohammadi
 
Fundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database UsersFundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database UsersMustafa Kamel Mohammadi
 

More from Mustafa Kamel Mohammadi (10)

Web design - Working with tables in HTML
Web design - Working with tables in HTMLWeb design - Working with tables in HTML
Web design - Working with tables in HTML
 
Web design - Working with Links and Images
Web design - Working with Links and ImagesWeb design - Working with Links and Images
Web design - Working with Links and Images
 
Web design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTMLWeb design - Working with Text and Lists in HTML
Web design - Working with Text and Lists in HTML
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introduction
 
Web design - How the Web works?
Web design - How the Web works?Web design - How the Web works?
Web design - How the Web works?
 
Web design - Applications and web application definition
Web design - Applications and web application definitionWeb design - Applications and web application definition
Web design - Applications and web application definition
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
 
Fundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database UsersFundamentals of Database system - Databases and Database Users
Fundamentals of Database system - Databases and Database Users
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Web design - Working with forms in HTML

  • 1. Fundamentals of Web designing Ministry of Higher Education Bamyan University Computer Science Department 1 Presented by : Mustafa Kamel Mohammadi Email : bamian.cs@gmail.com Working forms in HTML
  • 2. learning objective  In this chapter you will learn  How to create forms in HTML 2
  • 3. HTML forms  Forms are used frequently in many applications  Login  Adding records to system  ….  Form are consists of two parts  Form interface designed by HTML and CSS  Form action file that process form requests  Forms are created in HTML using <form> </form>  “action” attribute of <form> identifies the processing file by its URL  “method” attribute of <form> identifies the method of passing data from interface to processing file  Two methods are frequent in passing data “GET”, “POST” 3
  • 4. HTML form passing data  GET  Passes data to processing page by URL  Used when transferring small amount of data from interface to processing part  Used when needed to remember the browsing history  POST  Passes data to processing part by encapsulating data in a message package  Used for transferring large amount of data and so small  Data passed through POST method is not rememberable 4
  • 5. From controls  forms are made of some form elements called form controls like  Text fields  Password fields  Checkboxes  Radio buttons  Lists or menus  Buttons  Almost all form controls has attribute “name” which contains the name of form control element set by us.  We use this “name” attribute to get the value of element in processing page. 5
  • 6. Text fields  Used to enter data like name, zipcode, numbers, ….  Can get single line numeric and text data  <input /> with “type” attribute set to “text” create text field  It has some attribute like  Size : determines the length of text box in character  Maxlenght : specifies the maximum characters that we can type in text field  Value : specifies the default value typed in text field <input type=“text” name=“first_name” size=“20” value=“type first name here” /> 6
  • 7. Password field  Used to enter password data into the text box  It shows the (* ) in place of character typed in box  <input /> with “type” attribute set to “password” create password field  It has the same attributes as “text field” like “size”, “maxlenght”  It has no security policy for encrypting data <input type=“password” name=“user_pass” size=“20” /> 7
  • 8. Textarea  Is a large , multiline, scrollable text box  <textarea> </textarea> creates a text are box, “name” attr is a must.  “cols” and “rows” attributes specifies the width a height of text box <textarea name=“comment” col=“20” rows=“40” > </textarea> 8
  • 9. Check box  act as a multiple choice form input  <input /> with “type” attribute set to “checkbox” create chechbox  Because it allows multiple choice options so  Create all check boxes related to a single group with adding an attribute “name” to it.  Add “value” attribute to each of them and set the value.  If you want to set some options to be checked add attribute “Checked” with the value “checked” <input type=”checkbox” name=”fav_flavor” value=”chocolate” checked=”checked” /> 9
  • 10. Radio buttons  a single choice form input  <input /> with “type” attribute set to “radio” create radio buttons.  The same as checkboxes , but in a radio button group you can only choose one option rather than multiple options in check boxes  If you want to set one option to be checked add attribute “Checked” with the value “checked” <input type=”radio” name=”hand” value=”right” checked=”checked” /> 10
  • 11. Selection menu  allows user to select one from multiple options through a menu  Creating menu is the same as lists but their tags differs  Each option has a vlue attribute , this is the value that is sent when form is submitted. <select name=“country”> <option value=“af”>Afghanistan</option> <option value=“ir”>Iran</option> <option value=“pk”>Pakistan</option> <option value=“us”>United states</option> </select> 11
  • 12. Cont.  “size” attribute of <select> takes a numeric value, signifying the number of list options you want to make visible  To permit users to make multiple selections from the list, add a multiple attribute and set it equal to multiple.  To specify one option as preselected, define a selected attribute for the <option> tag and set it equal to selected. <select name=”pets” size=”4” multiple=”multiple”> <option value=”k9” selected=”selected”>Dogs</option> … </select> 12
  • 13. File fields  HTML allows you to select files from PC  <input /> with “type” attribute set to “file” create file fields  Set “name” attribute to specify uniquely a form control  To limit the type of files a visitor can upload, define an accept attribute and set it equal to the MIME type of the files you want to allow.  MIME stands for Multi-purpose Internet Mail Extensions <input type=”file” name=”profile_image” size=”20” maxlength=”50” accept=”image/gif”> 13
  • 14. Submit or Reset form  Site visitors click buttons either to send the completed form to the server (the Submit button) or to clear the form if they’ve made a mistake (the Reset but-ton)  To create a Submit or reset button, insert an <input>tag add a “type” attribute and set it equal to submit or reset. <input type=”submit” value=”Submit” name=”submit” /> <input type=”reset” value=”Reset” name=”reset” /> 14
  • 15. Hidden fields  HTML provides a mechanism by which you can include values in your form to be sent to the script that visitors never see. These values are defined using hidden fields.  Insert an <input>tag define a “type” attribute and set it equal to hidden  <input type=”hidden” name=”form_num” value=”C0003435” /> 15
  • 16. 16
  • 17. References • “HTML 4 dummies 5th edition” by Ed Tittel & Mary Burmeister • “HTML 5 designing rich internet applications” by Mathew Dawid • “HTML in ten simple steps” by Robert G. fuller 17