SlideShare a Scribd company logo
1 of 18
COMPUTER APPLICATIONS
CLASS X (Code 165)
TOPIC:
UNIT 2: HTML Forms
By
HIMANSHU PATHAK
Contents
ā€¢ Introduction
ā€¢ HTML Form Tag
ā€¢ Form Elements
Introduction
ā€¢ Web forms are one of the main points of
interaction between a user and a web site or
application.
ā€¢ An HTML form is used to collect user input.
ā€¢ The user input is most often sent to a server for
processing.
ā€¢ For example, during user registration you would
like to collect information such as name, email
address, credit card, etc.
Contā€¦
ā€¢ The back-end application (Server-side) will perform
required processing on the passed data based on
defined business logic inside the application.
ā€¢ There are various form elements available like text
fields, textarea fields, drop-down menus, radio
buttons, checkboxes, etc.
ā€¢ The HTML <form> tag is used to create an HTML
form and it has following syntax āˆ’
<form action="server url" method="get|post">
//input controls e.g. textfield, textarea,
//radiobutton, button
</form>
<form> tag attribute
ā€¢ action: Backend script ready to process your
passed data.
ā€¢ method: Method to be used to upload data. The
most frequently used are GET and POST
methods.
ā€¢ target: Specify the target window or frame
where the result of the script will be displayed. It
takes values like _blank, _self, _parent etc.
<label> Element
ā€¢ The <label> element is useful for screen-reader
users, because the screen-reader will read out
loud the label when the user focus on the input
element.
ā€¢ The for attribute of the <label> tag should be
equal to the id attribute of the <input> element
to bind them together.
ā€¢ <input type="radio" id="html" name="fav_lang"
value="HTML">
<label for="html">HTML</label>
Input Element
ā€¢ This is the most commonly used element within
HTML forms.
ā€¢ It allows you to specify various types of user
input fields, depending on the type attribute.
ā€¢ An input element can be of type text
field, password field, checkbox, radio
button, submit button, reset button, file select
box, as well as several new input
types introduced in HTML5.
ā€“ <input type="" name="">
Text Fields
ā€¢ Text fields are one line areas that allow the
user to input text.
ā€¢ Single-line text input controls are created using
an <input> element, whose type attribute has a
value of text.
<form>
<label for="un"> Username:</label>
<input type="text" name="un" id="un">
</form>
Password Field
ā€¢ Password fields are similar to text fields.
ā€¢ The only difference is characters in a password field
are masked, i.e. they are shown as asterisks or dots.
ā€¢ This is to prevent someone else from reading the
password on the screen.
ā€¢ This is also a single-line text input controls created
using an <input> element whose type attribute has a
value of password.
<form>
<label for="up">Password:</label>
<input type="password" name="up" id="up">
</form>
Radio Buttons
ā€¢ Radio buttons are used to let the user select exactly
one option from a pre-defined set of options.
ā€¢ It is created using an <input> element
whose type attribute has a value of radio.
<form>
<input type = "radio" name = ā€œGender" value = ā€œmale">
Male
<input type = "radio" name = ā€œGender" value = ā€œfemale">
Female
</form>
Checkboxes
ā€¢ Checkboxes allows the user to select one or more
option from a pre-defined set of options.
ā€¢ It is created using an <input> element
whose type attribute has a value of checkbox.
ā€¢ Set to checked if you want to select it by default.
<form>
<input type = "checkbox" name = ā€œsports"> Cricket
<input type = "checkbox" name = ā€œsports"> Tennis
<input type = "checkbox" name = ā€œsports"> Chess
</form>
File Select box
ā€¢ The file fields allow a user to browse for a local file
and send it as an attachment with the form data.
ā€¢ This is also created using the <input> element but
type attribute is set to file.
<form>
<input type = "file" name = "fileupload" accept =
"image/*" />
</form>
ā€¢ accept attribute specifies the types of files that the
server accepts.
Textarea
ā€¢ Textarea is a multiple-line text input control that
allows a user to enter more than one line of text.
ā€¢ Multi-line text input controls are created using
an <textarea> element.
<form>
Description : <br>
<textarea rows = "5" cols = "50" name = "description">
Enter description here...
</textarea>
</form>
Select Boxes
ā€¢ A select box, also called drop down box which
provides option, from where a user can select one or
more options.
ā€¢ Select box is created using the <select> element
and <option> element.
ā€¢ The <option> elements within the <select> element
define each list item.
<select name = "dropdown">
<option value = "Maths" selected> Maths </option>
<option value = "Physics"> Physics </option>
</select>
Button Controls
ā€¢ There are various ways in HTML to create
clickable buttons.
ā€¢ We can create a clickable button using
<input>tag by setting its type attribute to button
/ submit / reset / image.
ā€¢ type = ā€œbuttonā€ creates a button that is used to
trigger a client-side script when the user clicks
that button.
ā€¢ <input type="button" onclick="alert('Hello
World!')" value="Click Me!">
Submit & Reset Button
ā€¢ A submit button is used to send the form data to
a web server.
ā€¢ When submit button is clicked the form data is
sent to the file specified in the
form's action attribute to process the submitted
data.
ā€¢ A reset button resets all the forms control to
default values.
Contā€¦
<form action="action.php" method="post">
<label for="fn">First Name:</label>
<input type="text" name="first-name" id="fn">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
Summary
ā€¢ HTML Forms & their various elements
ā€¢ In the next class, we will start Unit II ā€“ Embed
Multimedia in detail.
ā€¢Thanks

More Related Content

What's hot

Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptzahid7578
Ā 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Himanshu Kumar
Ā 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet pptabhilashagupta
Ā 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
Ā 
Html links
Html linksHtml links
Html linkseShikshak
Ā 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScriptRavi Bhadauria
Ā 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript BasicsVishal Mittal
Ā 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
Ā 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginnersjeroenvdmeer
Ā 
Web design - Working with forms in HTML
Web design - Working with forms in HTMLWeb design - Working with forms in HTML
Web design - Working with forms in HTMLMustafa Kamel Mohammadi
Ā 
New Form Element in HTML5
New Form Element in HTML5New Form Element in HTML5
New Form Element in HTML5Zahra Rezwana
Ā 
Html images syntax
Html images syntaxHtml images syntax
Html images syntaxJayjZens
Ā 
Java script
Java scriptJava script
Java scriptShyam Khant
Ā 
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 ScriptFahim Abdullah
Ā 

What's hot (20)

Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
Ā 
Html coding
Html codingHtml coding
Html coding
Ā 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
Ā 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Ā 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
Ā 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Ā 
Html links
Html linksHtml links
Html links
Ā 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
Ā 
Html frames
Html framesHtml frames
Html frames
Ā 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
Ā 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Ā 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
Ā 
Html ppt
Html pptHtml ppt
Html ppt
Ā 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
Ā 
Web design - Working with forms in HTML
Web design - Working with forms in HTMLWeb design - Working with forms in HTML
Web design - Working with forms in HTML
Ā 
New Form Element in HTML5
New Form Element in HTML5New Form Element in HTML5
New Form Element in HTML5
Ā 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
Ā 
Java script
Java scriptJava script
Java script
Ā 
HTML
HTMLHTML
HTML
Ā 
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
Ā 

Similar to Html forms

uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 htmlAbhishek Kesharwani
Ā 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio videoSaad Sheikh
Ā 
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 validationMaitree Patel
Ā 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)Salman Memon
Ā 
FormL13.pptx
FormL13.pptxFormL13.pptx
FormL13.pptxserd4
Ā 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerNuzhat Memon
Ā 
Gitika html ppt
Gitika html pptGitika html ppt
Gitika html pptgitika -
Ā 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html formsCK Yang
Ā 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html formsCK Yang
Ā 
web-lab2 for computer science html tss css java
web-lab2 for computer science html tss css javaweb-lab2 for computer science html tss css java
web-lab2 for computer science html tss css javashereifhany
Ā 
Html forms
Html formsHtml forms
Html formsKoreshPadhi
Ā 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML FormsMike Crabb
Ā 
HTML - FORMS.pptx
HTML - FORMS.pptxHTML - FORMS.pptx
HTML - FORMS.pptxNyssakotian
Ā 

Similar to Html forms (20)

uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Ā 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
Ā 
Html4
Html4Html4
Html4
Ā 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
Ā 
Forms
FormsForms
Forms
Ā 
Html4
Html4Html4
Html4
Ā 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
Ā 
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
Ā 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Ā 
Html forms
Html formsHtml forms
Html forms
Ā 
FormL13.pptx
FormL13.pptxFormL13.pptx
FormL13.pptx
Ā 
HTML_Forms_.ppt
HTML_Forms_.pptHTML_Forms_.ppt
HTML_Forms_.ppt
Ā 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Ā 
Gitika html ppt
Gitika html pptGitika html ppt
Gitika html ppt
Ā 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 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
Ā 
web-lab2 for computer science html tss css java
web-lab2 for computer science html tss css javaweb-lab2 for computer science html tss css java
web-lab2 for computer science html tss css java
Ā 
Html forms
Html formsHtml forms
Html forms
Ā 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
Ā 
HTML - FORMS.pptx
HTML - FORMS.pptxHTML - FORMS.pptx
HTML - FORMS.pptx
Ā 

More from Himanshu Pathak

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerceHimanshu Pathak
Ā 
Digital property rights
Digital property rightsDigital property rights
Digital property rightsHimanshu Pathak
Ā 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rightsHimanshu Pathak
Ā 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber EthicsHimanshu Pathak
Ā 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2Himanshu Pathak
Ā 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introductionHimanshu Pathak
Ā 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tagsHimanshu Pathak
Ā 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tagsHimanshu Pathak
Ā 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlHimanshu Pathak
Ā 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologiesHimanshu Pathak
Ā 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsHimanshu Pathak
Ā 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internetHimanshu Pathak
Ā 

More from Himanshu Pathak (18)

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerce
Ā 
Digital property rights
Digital property rightsDigital property rights
Digital property rights
Ā 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rights
Ā 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber Ethics
Ā 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
Ā 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
Ā 
Html multimedia
Html multimediaHtml multimedia
Html multimedia
Ā 
Html tables
Html tablesHtml tables
Html tables
Ā 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tags
Ā 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
Ā 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
Ā 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
Ā 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologies
Ā 
Web services
Web servicesWeb services
Web services
Ā 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
Ā 
Internet protocol
Internet protocolInternet protocol
Internet protocol
Ā 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internet
Ā 
What is Computer?
What is Computer?What is Computer?
What is Computer?
Ā 

Recently uploaded

call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
Ā 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
Ā 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
Ā 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
Ā 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
Ā 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Nguyen Thanh Tu Collection
Ā 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
Ā 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
Ā 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
Ā 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
Ā 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
Ā 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
Ā 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
Ā 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
Ā 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
Ā 

Recently uploaded (20)

call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Kamla Market (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Ā 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
Ā 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
Ā 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Ā 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
Ā 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
Ā 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Ā 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
Ā 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
Ā 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
Ā 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Ā 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
Ā 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
Ā 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
Ā 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
Ā 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Ā 

Html forms

  • 1. COMPUTER APPLICATIONS CLASS X (Code 165) TOPIC: UNIT 2: HTML Forms By HIMANSHU PATHAK
  • 2. Contents ā€¢ Introduction ā€¢ HTML Form Tag ā€¢ Form Elements
  • 3. Introduction ā€¢ Web forms are one of the main points of interaction between a user and a web site or application. ā€¢ An HTML form is used to collect user input. ā€¢ The user input is most often sent to a server for processing. ā€¢ For example, during user registration you would like to collect information such as name, email address, credit card, etc.
  • 4. Contā€¦ ā€¢ The back-end application (Server-side) will perform required processing on the passed data based on defined business logic inside the application. ā€¢ There are various form elements available like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc. ā€¢ The HTML <form> tag is used to create an HTML form and it has following syntax āˆ’ <form action="server url" method="get|post"> //input controls e.g. textfield, textarea, //radiobutton, button </form>
  • 5. <form> tag attribute ā€¢ action: Backend script ready to process your passed data. ā€¢ method: Method to be used to upload data. The most frequently used are GET and POST methods. ā€¢ target: Specify the target window or frame where the result of the script will be displayed. It takes values like _blank, _self, _parent etc.
  • 6. <label> Element ā€¢ The <label> element is useful for screen-reader users, because the screen-reader will read out loud the label when the user focus on the input element. ā€¢ The for attribute of the <label> tag should be equal to the id attribute of the <input> element to bind them together. ā€¢ <input type="radio" id="html" name="fav_lang" value="HTML"> <label for="html">HTML</label>
  • 7. Input Element ā€¢ This is the most commonly used element within HTML forms. ā€¢ It allows you to specify various types of user input fields, depending on the type attribute. ā€¢ An input element can be of type text field, password field, checkbox, radio button, submit button, reset button, file select box, as well as several new input types introduced in HTML5. ā€“ <input type="" name="">
  • 8. Text Fields ā€¢ Text fields are one line areas that allow the user to input text. ā€¢ Single-line text input controls are created using an <input> element, whose type attribute has a value of text. <form> <label for="un"> Username:</label> <input type="text" name="un" id="un"> </form>
  • 9. Password Field ā€¢ Password fields are similar to text fields. ā€¢ The only difference is characters in a password field are masked, i.e. they are shown as asterisks or dots. ā€¢ This is to prevent someone else from reading the password on the screen. ā€¢ This is also a single-line text input controls created using an <input> element whose type attribute has a value of password. <form> <label for="up">Password:</label> <input type="password" name="up" id="up"> </form>
  • 10. Radio Buttons ā€¢ Radio buttons are used to let the user select exactly one option from a pre-defined set of options. ā€¢ It is created using an <input> element whose type attribute has a value of radio. <form> <input type = "radio" name = ā€œGender" value = ā€œmale"> Male <input type = "radio" name = ā€œGender" value = ā€œfemale"> Female </form>
  • 11. Checkboxes ā€¢ Checkboxes allows the user to select one or more option from a pre-defined set of options. ā€¢ It is created using an <input> element whose type attribute has a value of checkbox. ā€¢ Set to checked if you want to select it by default. <form> <input type = "checkbox" name = ā€œsports"> Cricket <input type = "checkbox" name = ā€œsports"> Tennis <input type = "checkbox" name = ā€œsports"> Chess </form>
  • 12. File Select box ā€¢ The file fields allow a user to browse for a local file and send it as an attachment with the form data. ā€¢ This is also created using the <input> element but type attribute is set to file. <form> <input type = "file" name = "fileupload" accept = "image/*" /> </form> ā€¢ accept attribute specifies the types of files that the server accepts.
  • 13. Textarea ā€¢ Textarea is a multiple-line text input control that allows a user to enter more than one line of text. ā€¢ Multi-line text input controls are created using an <textarea> element. <form> Description : <br> <textarea rows = "5" cols = "50" name = "description"> Enter description here... </textarea> </form>
  • 14. Select Boxes ā€¢ A select box, also called drop down box which provides option, from where a user can select one or more options. ā€¢ Select box is created using the <select> element and <option> element. ā€¢ The <option> elements within the <select> element define each list item. <select name = "dropdown"> <option value = "Maths" selected> Maths </option> <option value = "Physics"> Physics </option> </select>
  • 15. Button Controls ā€¢ There are various ways in HTML to create clickable buttons. ā€¢ We can create a clickable button using <input>tag by setting its type attribute to button / submit / reset / image. ā€¢ type = ā€œbuttonā€ creates a button that is used to trigger a client-side script when the user clicks that button. ā€¢ <input type="button" onclick="alert('Hello World!')" value="Click Me!">
  • 16. Submit & Reset Button ā€¢ A submit button is used to send the form data to a web server. ā€¢ When submit button is clicked the form data is sent to the file specified in the form's action attribute to process the submitted data. ā€¢ A reset button resets all the forms control to default values.
  • 17. Contā€¦ <form action="action.php" method="post"> <label for="fn">First Name:</label> <input type="text" name="first-name" id="fn"> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form>
  • 18. Summary ā€¢ HTML Forms & their various elements ā€¢ In the next class, we will start Unit II ā€“ Embed Multimedia in detail. ā€¢Thanks