SlideShare a Scribd company logo
1 of 28
Download to read offline
HTML Forms
Ravinder Kamboj
Assistant Professor
LCET, Katani Kalan
HTML Forms
• HTML Forms are required when you want to
collect some data from the site visitor.
• For example during user registration you would
like to collect information such as name, email
address, credit card, etc.
• A form will take input from the site visitor and
then will post it to a back-end application such as
CGI, ASP Script or PHP script etc.
• The back-end application will perform required
processing on the passed data based on defined
business logic inside the application.
Elements in forms
• There are various form elements available like:
• Text fields
• Textarea fields
• Drop-down menus
• Radio buttons
• Checkboxes
• etc.
Syntax
• The HTML <form> tag is used to create an
HTML form and it has following syntax:
<form action="Script URL“
method="GET|POST">
form elements like input, textarea etc.
</form>
Form Attributes
HTML Form Controls
• There are different types of form controls that
you can use to collect data using HTML form:
– Text Input Controls
– Checkboxes Controls
– Radio Box Controls
– Select Box Controls
– File Select boxes
– Hidden ControlsClickable Buttons
– Submit and Reset Button
Text Input Controls
• There are three types of text input used on forms:
– Single-line text input controls - This control is used for
items that require only one line of user input, such as
search boxes or names. They are created using HTML
<input> tag.
– Password input controls - This is also a single-line text
input but it masks the character as soon as a user enters it.
They are also created using HTMl <input> tag.
– Multi-line text input controls - This is used when the user
is required to give details that may be longer than a single
sentence. Multi-line input controls are created using HTML
<textarea> tag.
Single-line text input controls
• This control is used for items that require only one line of user input, such
as search boxes or names. They are created using HTML <input> tag.
<html>
<head>
<title>Text Input Control</title>
</head>
<body>
<form >
First name: <input type="text" name="first_name" />
<br>
Last name: <input type="text" name="last_name" />
</form>
</body>
</html>
Attributes for text
Password input controls
• This is also a single-line text input but it masks the character as
soon as a user enters it.
• They are also created using HTML <input> tag but type
attribute is set to password.
<html>
<head>
<title>Password Input Control</title>
</head>
<body>
<form >
User ID : <input type="text" name="user_id" />
<br>
Password: <input type="password" name="password" />
</form>
</body>
</html>
Multiple-Line Text Input Controls
• This is used when the user is required to give
details that may be longer than a single
sentence.
• Multi-line input controls are created using
HTML <textarea> tag.
Example
<html>
<head>
<title>Multiple-Line Input Control</title>
</head><body>
<form>
Description : <br />
<textarea rows="5" cols="50" name="description">
Enter description here...
</textarea>
</form>
</body>
</html>
Attributes of textarea
• Following is the list of attributes for
<textarea> tag.
Checkbox Control
• Checkboxes are used when more than one
option is required to be selected.
• They are also created using HTML <input> tag
but type attribute is set to checkbox.
• Attributes of <checkbox> tag:
Example
<html>
<head>
<title>Checkbox Control</title>
</head>
<body>
<form>
<input type="checkbox" name="maths" value="on"> Maths
<input type="checkbox" name="physics" value="on"> Physics
</form>
</body>
</html>
Radio Button Control
• Radio buttons are used when out of many
options, just one option is required to be
selected.
• They are also created using HTML <input> tag
but type attribute is set to radio.
Example
<html>
<head>
<title>Radio Box Control</title>
</head>
<body>
<form>
<input type="radio" name="subject" value="maths"> Maths
<input type="radio" name="subject" value="physics"> Physics
</form>
</body>
</html>
Attributes
• Following is the list of attributes for radio
button:
Select Box Control
• A select box, also called drop down box which provides option to
list down various options in the form of drop down list, from
where a user can select one or more options.
<html>
<head>
<title>Select Box Control</title>
</head>
<body>
<form>
<select name="dropdown">
<option value="Maths" selected>Maths</option>
<option value="Physics">Physics</option>
</select>
</form>
</body>
</html>
Attributes of select
File Upload Box
• If you want to allow a user to upload a file to
your web site, you will need to use a file
upload box, also known as a file select box.
• This is also created using the <input> element
but type attribute is set to file.
Example
<html>
<head>
<title>File Upload Box</title>
</head>
<body><form>
Select file:
<input type="file" name="fileupload" accept="image/*" />
</form>
</body>
</html>
Attributes of file upload
Button Controls
• There are various ways in HTML to create
clickable buttons.
• You can also create a clickable button using
<input> tag by setting its type attribute to
button.
• The type attribute can take the following
• values:
Values
Example
<html>
<head>
<title>Buttons</title>
</head>
<body>
<form>
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
<input type="button" name="ok" value="OK" />
<input type="image" name="imagebutton" src="images/logo.jpg" />
</form>
</body>
</html>
Hidden Form Controls
• Hidden form controls are used to hide data
inside the page which later on can be pushed
to the server.
• This control hides inside the code and does
not appear on the actual page.
Example
<html>
<head>
<title>File Upload Box</title>
</head>
<body>
<form>
<p>This is page 10</p>
<input type="hidden" name="pagename" value="10" />
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
</body>
</html>

More Related Content

What's hot

Html images syntax
Html images syntaxHtml images syntax
Html images syntaxJayjZens
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tagsHimanshu Pathak
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation Salman Memon
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to htmlpalhaftab
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Chris Poteet
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formattingeShikshak
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptAndres Baravalle
 

What's hot (20)

HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Html list
Html listHtml list
Html list
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Html text and formatting
Html text and formattingHtml text and formatting
Html text and formatting
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
html-table
html-tablehtml-table
html-table
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Js ppt
Js pptJs ppt
Js ppt
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Html
HtmlHtml
Html
 

Viewers also liked

[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tagsHyejin Oh
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTMLDoncho Minkov
 
Creating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
Creating User Friendly Joomla! Websites and Forms | Joomla! Day DeutschlandCreating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
Creating User Friendly Joomla! Websites and Forms | Joomla! Day DeutschlandThemePartner
 
Web Engineering - Web Application Testing
Web Engineering - Web Application TestingWeb Engineering - Web Application Testing
Web Engineering - Web Application TestingNosheen Qamar
 
Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyNosheen Qamar
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTMLMarlon Jamera
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTMLNosheen Qamar
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSSNosheen Qamar
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASICUKM PROGRESS
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML FormNosheen Qamar
 
Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web EngineeringNosheen Qamar
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginnersMunir Hoque
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tagsHyejin Oh
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesNosheen Qamar
 

Viewers also liked (20)

2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
Html forms
Html formsHtml forms
Html forms
 
Html forms
Html formsHtml forms
Html forms
 
[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags[Basic HTML/CSS] 4. html - form tags
[Basic HTML/CSS] 4. html - form tags
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Creating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
Creating User Friendly Joomla! Websites and Forms | Joomla! Day DeutschlandCreating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
Creating User Friendly Joomla! Websites and Forms | Joomla! Day Deutschland
 
Web Engineering - Web Application Testing
Web Engineering - Web Application TestingWeb Engineering - Web Application Testing
Web Engineering - Web Application Testing
 
Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and Accuracy
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTML
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
PROGRESS - CSS BASIC
PROGRESS - CSS BASICPROGRESS - CSS BASIC
PROGRESS - CSS BASIC
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web Engineering
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Web engineering lecture 1
Web engineering lecture 1Web engineering lecture 1
Web engineering lecture 1
 
Java script basics
Java script basicsJava script basics
Java script basics
 

Similar to HTML Forms (20)

HTML-Forms
HTML-FormsHTML-Forms
HTML-Forms
 
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
 
Gitika html ppt
Gitika html pptGitika html ppt
Gitika html ppt
 
Html Forms
Html FormsHtml Forms
Html Forms
 
Presentation1
Presentation1Presentation1
Presentation1
 
Html4
Html4Html4
Html4
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
FormL13.pptx
FormL13.pptxFormL13.pptx
FormL13.pptx
 
Html forms
Html formsHtml forms
Html forms
 
Html4
Html4Html4
Html4
 
Html forms
Html formsHtml forms
Html forms
 
Html Guide
Html GuideHtml Guide
Html Guide
 
HTML - FORMS.pptx
HTML - FORMS.pptxHTML - FORMS.pptx
HTML - FORMS.pptx
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
 
5. Frames & Forms.pdf
5. Frames & Forms.pdf5. Frames & Forms.pdf
5. Frames & Forms.pdf
 
Html form
Html formHtml form
Html form
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML forms
 
I211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docxI211 – Information Infrastructure IILecture 20TodayCGI.docx
I211 – Information Infrastructure IILecture 20TodayCGI.docx
 

More from Ravinder Kamboj

More from Ravinder Kamboj (14)

Data warehouse,data mining & Big Data
Data warehouse,data mining & Big DataData warehouse,data mining & Big Data
Data warehouse,data mining & Big Data
 
DDBMS
DDBMSDDBMS
DDBMS
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Query processing
Query processingQuery processing
Query processing
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data Base
 
Architecture of dbms(lecture 3)
Architecture of dbms(lecture 3)Architecture of dbms(lecture 3)
Architecture of dbms(lecture 3)
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
Lecture 1&amp;2(rdbms-ii)
Lecture 1&amp;2(rdbms-ii)Lecture 1&amp;2(rdbms-ii)
Lecture 1&amp;2(rdbms-ii)
 
Java script
Java scriptJava script
Java script
 
File Management
File ManagementFile Management
File Management
 
DHTML
DHTMLDHTML
DHTML
 
CSA lecture-1
CSA lecture-1CSA lecture-1
CSA lecture-1
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 

Recently uploaded

Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Osopher
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPCeline George
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrancejulius27264
 
Jason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentJason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentInMediaRes1
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...DrVipulVKapoor
 
Paul Dobryden In Media Res Media Component
Paul Dobryden In Media Res Media ComponentPaul Dobryden In Media Res Media Component
Paul Dobryden In Media Res Media ComponentInMediaRes1
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptxUmeshTimilsina1
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressMaria Paula Aroca
 

Recently uploaded (20)

Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
 
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERP
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrance
 
Jason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentJason Potel In Media Res Media Component
Jason Potel In Media Res Media Component
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...
Geoffrey Chaucer Works II UGC NET JRF TGT PGT MA PHD Entrance Exam II History...
 
Chi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical VariableChi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical Variable
 
Paul Dobryden In Media Res Media Component
Paul Dobryden In Media Res Media ComponentPaul Dobryden In Media Res Media Component
Paul Dobryden In Media Res Media Component
 
CARNAVAL COM MAGIA E EUFORIA _
CARNAVAL COM MAGIA E EUFORIA            _CARNAVAL COM MAGIA E EUFORIA            _
CARNAVAL COM MAGIA E EUFORIA _
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian Congress
 
Teaching Critical AI Literacies - Maha Bali
Teaching Critical AI Literacies - Maha BaliTeaching Critical AI Literacies - Maha Bali
Teaching Critical AI Literacies - Maha Bali
 

HTML Forms

  • 1. HTML Forms Ravinder Kamboj Assistant Professor LCET, Katani Kalan
  • 2. HTML Forms • HTML Forms are required when you want to collect some data from the site visitor. • For example during user registration you would like to collect information such as name, email address, credit card, etc. • A form will take input from the site visitor and then will post it to a back-end application such as CGI, ASP Script or PHP script etc. • The back-end application will perform required processing on the passed data based on defined business logic inside the application.
  • 3. Elements in forms • There are various form elements available like: • Text fields • Textarea fields • Drop-down menus • Radio buttons • Checkboxes • etc.
  • 4. Syntax • The HTML <form> tag is used to create an HTML form and it has following syntax: <form action="Script URL“ method="GET|POST"> form elements like input, textarea etc. </form>
  • 6. HTML Form Controls • There are different types of form controls that you can use to collect data using HTML form: – Text Input Controls – Checkboxes Controls – Radio Box Controls – Select Box Controls – File Select boxes – Hidden ControlsClickable Buttons – Submit and Reset Button
  • 7. Text Input Controls • There are three types of text input used on forms: – Single-line text input controls - This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML <input> tag. – Password input controls - This is also a single-line text input but it masks the character as soon as a user enters it. They are also created using HTMl <input> tag. – Multi-line text input controls - This is used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are created using HTML <textarea> tag.
  • 8. Single-line text input controls • This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML <input> tag. <html> <head> <title>Text Input Control</title> </head> <body> <form > First name: <input type="text" name="first_name" /> <br> Last name: <input type="text" name="last_name" /> </form> </body> </html>
  • 10. Password input controls • This is also a single-line text input but it masks the character as soon as a user enters it. • They are also created using HTML <input> tag but type attribute is set to password. <html> <head> <title>Password Input Control</title> </head> <body> <form > User ID : <input type="text" name="user_id" /> <br> Password: <input type="password" name="password" /> </form> </body> </html>
  • 11. Multiple-Line Text Input Controls • This is used when the user is required to give details that may be longer than a single sentence. • Multi-line input controls are created using HTML <textarea> tag.
  • 12. Example <html> <head> <title>Multiple-Line Input Control</title> </head><body> <form> Description : <br /> <textarea rows="5" cols="50" name="description"> Enter description here... </textarea> </form> </body> </html>
  • 13. Attributes of textarea • Following is the list of attributes for <textarea> tag.
  • 14. Checkbox Control • Checkboxes are used when more than one option is required to be selected. • They are also created using HTML <input> tag but type attribute is set to checkbox. • Attributes of <checkbox> tag:
  • 15. Example <html> <head> <title>Checkbox Control</title> </head> <body> <form> <input type="checkbox" name="maths" value="on"> Maths <input type="checkbox" name="physics" value="on"> Physics </form> </body> </html>
  • 16. Radio Button Control • Radio buttons are used when out of many options, just one option is required to be selected. • They are also created using HTML <input> tag but type attribute is set to radio.
  • 17. Example <html> <head> <title>Radio Box Control</title> </head> <body> <form> <input type="radio" name="subject" value="maths"> Maths <input type="radio" name="subject" value="physics"> Physics </form> </body> </html>
  • 18. Attributes • Following is the list of attributes for radio button:
  • 19. Select Box Control • A select box, also called drop down box which provides option to list down various options in the form of drop down list, from where a user can select one or more options. <html> <head> <title>Select Box Control</title> </head> <body> <form> <select name="dropdown"> <option value="Maths" selected>Maths</option> <option value="Physics">Physics</option> </select> </form> </body> </html>
  • 21. File Upload Box • If you want to allow a user to upload a file to your web site, you will need to use a file upload box, also known as a file select box. • This is also created using the <input> element but type attribute is set to file.
  • 22. Example <html> <head> <title>File Upload Box</title> </head> <body><form> Select file: <input type="file" name="fileupload" accept="image/*" /> </form> </body> </html>
  • 24. Button Controls • There are various ways in HTML to create clickable buttons. • You can also create a clickable button using <input> tag by setting its type attribute to button. • The type attribute can take the following • values:
  • 26. Example <html> <head> <title>Buttons</title> </head> <body> <form> <input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> <input type="button" name="ok" value="OK" /> <input type="image" name="imagebutton" src="images/logo.jpg" /> </form> </body> </html>
  • 27. Hidden Form Controls • Hidden form controls are used to hide data inside the page which later on can be pushed to the server. • This control hides inside the code and does not appear on the actual page.
  • 28. Example <html> <head> <title>File Upload Box</title> </head> <body> <form> <p>This is page 10</p> <input type="hidden" name="pagename" value="10" /> <input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </form> </body> </html>