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)

Html forms
Html formsHtml forms
Html forms
 
Html ppt
Html pptHtml ppt
Html ppt
 
Css
CssCss
Css
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html tables
Html tablesHtml tables
Html tables
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Html tags or elements
Html tags or elementsHtml tags or elements
Html tags or elements
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
 
HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
 
Html links
Html linksHtml links
Html links
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Css backgrounds
Css   backgroundsCss   backgrounds
Css backgrounds
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
Span and Div tags in HTML
Span and Div tags in HTMLSpan and Div tags in HTML
Span and Div tags in HTML
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 

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
 
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
 

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

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

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