SlideShare a Scribd company logo
1 of 16
Higher
HTML Forms and Validation
What is a form?
The HTML <form> element creates a form that is used to collect user input. It is
often used along side PHP and can be used for:
 Emailing and contact forms,
 Login and Registration,
 Searching bars,
 Inputting data into an online system
 Updating information on a database
The Form Tag
To create a form in HTML the following tag is used:
<form>
Form elements
</form>
Form Elements
Text
Single line text input
<input type=“text”>
Form Elements
Number
Number input like for example age. This can be limited to a range and will prevent
the user from entering anything other than a number.
<input type=“number”>
Form Elements
Textarea
Used when a paragraph may need to be submitted. Like for example a comment box.
<textarea> Enter text here...</textarea>
Form Elements
Radio Buttons
Used when there is multiple options for the user. For example choice of Gender or
whether they are a student or a teacher.
<input type="radio" > Male
<input type="radio" >Female
<input type="radio" > Other
Form Elements
Select - Drop Down Menu
Used then there is a list of items to choose from.
Select your year:
<Select name=“year”>
<option value=“S4”> S4 </option>
<option value=“S5”> S5 </option>
<option value=“S6”> S6 </option>
</select>
Form Elements
Select – Drop down Menu with Size Attribute
Select element that will offer a number of options and if it is larger than what is stated then a
scroll bar will be given.
Select your car:
<select size="3“>
<option value="volvo">Volvo</option>
<option value="nissan">Nissan</option>
<option value="ford">Ford</option>
<option value="audi">Audi</option>
</select>
Form Elements
Select – Drop down Menu with Size Attribute with multiple choice
Select element that will offer a number of options and if it is larger than what is stated
then a scroll bar will be given.
Select your car:
<select size="3“ multiple>
<option value="volvo">Volvo</option>
<option value="nissan">Nissan</option>
<option value="ford">Ford</option>
<option value="audi">Audi</option>
</select>
Form Elements
Submit Button
When the submit button is pressed the form is submitted and the browser will show
any errors to correct or send the details of the form to the server.
<input type="submit" value="Submit">
Javascript Submit Alerts
Javascript can be used to inform a user that they have enter by using the onclick
function.
<input type="submit" onclick ="alert ('Form Entered')" value="Submit">
Pre populated input
Form elements can be pre populated to help the user understand what is to be inputted. This can be left
unchanged, deleted or even edited by the user.
Username: <input type="text" Value="Enter your Username">
<textarea name="comment" > Enter text here... </textarea>
<input type="radio" name="gender" value="male" checked> Male
Form Validation
Length Check
Prevents the user from entering more that what is required.
<textarea name="comment" maxlength="6">Enter text here...</textarea>
The above will prevent the user from entering anything more than 6 characters.
Form Validation
Presence Check
Ensures that the user has entered something in an important field before submitting to the server.
Username: <input type="text" Value="Enter your Username" required>
Form Validation
Range Check
Ensures that the user has entered a number that is between a set of numbers
<input type="number" name="quantity" min="1" max="5">

More Related Content

What's hot

Livehelp Server for WordPress User Guide Ver 3
Livehelp Server for WordPress User Guide Ver 3Livehelp Server for WordPress User Guide Ver 3
Livehelp Server for WordPress User Guide Ver 3ActiveHelper
 
Support Panel Console 3 User Guide
Support  Panel Console 3 User GuideSupport  Panel Console 3 User Guide
Support Panel Console 3 User GuideActiveHelper
 
Building html forms
Building html formsBuilding html forms
Building html formsice es
 
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5ActiveHelper
 
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0ActiveHelper
 
Support panel mobile user guide for Android - English
Support panel mobile user guide for Android - EnglishSupport panel mobile user guide for Android - English
Support panel mobile user guide for Android - EnglishActiveHelper
 
En3405 i web web manager user manual
En3405 i web web manager user manualEn3405 i web web manager user manual
En3405 i web web manager user manualHeo Gòm
 
Entering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML FormsEntering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML Formssathish sak
 
Session plan for web technologies lab subject
Session plan for web technologies lab subjectSession plan for web technologies lab subject
Session plan for web technologies lab subjectupen rao
 
KOMSystems Productivity Benchmarking Application Tutorial
KOMSystems Productivity Benchmarking Application TutorialKOMSystems Productivity Benchmarking Application Tutorial
KOMSystems Productivity Benchmarking Application Tutorialkomsystems
 
Result Recorder app for windows phone
Result Recorder app for windows phoneResult Recorder app for windows phone
Result Recorder app for windows phoneMannu Malhotra
 
APPOL Features Overview
APPOL Features OverviewAPPOL Features Overview
APPOL Features Overviewryancowsert
 
I requestmanager for_x3
I requestmanager for_x3I requestmanager for_x3
I requestmanager for_x3garryguddu
 
Blue Dart Shipping Integration WooCommerce
Blue Dart Shipping Integration WooCommerce Blue Dart Shipping Integration WooCommerce
Blue Dart Shipping Integration WooCommerce SoftProdigy
 
I requestmanager configuration_and_customization022813
I requestmanager configuration_and_customization022813I requestmanager configuration_and_customization022813
I requestmanager configuration_and_customization022813garryguddu
 

What's hot (20)

Livehelp Server for WordPress User Guide Ver 3
Livehelp Server for WordPress User Guide Ver 3Livehelp Server for WordPress User Guide Ver 3
Livehelp Server for WordPress User Guide Ver 3
 
Html forms
Html formsHtml forms
Html forms
 
Support Panel Console 3 User Guide
Support  Panel Console 3 User GuideSupport  Panel Console 3 User Guide
Support Panel Console 3 User Guide
 
Building html forms
Building html formsBuilding html forms
Building html forms
 
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5
ActiveHelper Livehelp Server User Guide for Joomla Ver 3 for Joomla 2.5
 
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0
ActiveHelper LiveHelp Server Quickstart for Joomla 2.5 & 3.0
 
Clean login websitecreationhub.com
Clean login  websitecreationhub.comClean login  websitecreationhub.com
Clean login websitecreationhub.com
 
Support panel mobile user guide for Android - English
Support panel mobile user guide for Android - EnglishSupport panel mobile user guide for Android - English
Support panel mobile user guide for Android - English
 
En3405 i web web manager user manual
En3405 i web web manager user manualEn3405 i web web manager user manual
En3405 i web web manager user manual
 
Translation Company
Translation CompanyTranslation Company
Translation Company
 
Entering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML FormsEntering User Data from a Web Page HTML Forms
Entering User Data from a Web Page HTML Forms
 
Live chat in odoo
Live chat in odooLive chat in odoo
Live chat in odoo
 
Session plan for web technologies lab subject
Session plan for web technologies lab subjectSession plan for web technologies lab subject
Session plan for web technologies lab subject
 
Welcome To Fid Pro
Welcome To Fid ProWelcome To Fid Pro
Welcome To Fid Pro
 
KOMSystems Productivity Benchmarking Application Tutorial
KOMSystems Productivity Benchmarking Application TutorialKOMSystems Productivity Benchmarking Application Tutorial
KOMSystems Productivity Benchmarking Application Tutorial
 
Result Recorder app for windows phone
Result Recorder app for windows phoneResult Recorder app for windows phone
Result Recorder app for windows phone
 
APPOL Features Overview
APPOL Features OverviewAPPOL Features Overview
APPOL Features Overview
 
I requestmanager for_x3
I requestmanager for_x3I requestmanager for_x3
I requestmanager for_x3
 
Blue Dart Shipping Integration WooCommerce
Blue Dart Shipping Integration WooCommerce Blue Dart Shipping Integration WooCommerce
Blue Dart Shipping Integration WooCommerce
 
I requestmanager configuration_and_customization022813
I requestmanager configuration_and_customization022813I requestmanager configuration_and_customization022813
I requestmanager configuration_and_customization022813
 

Similar to Higher - HTML forms (20)

Html forms
Html formsHtml forms
Html forms
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
Forms
FormsForms
Forms
 
Lectures-web
Lectures-webLectures-web
Lectures-web
 
Html form tag
Html form tagHtml form tag
Html form tag
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
HTML FORMS.pptx
HTML FORMS.pptxHTML FORMS.pptx
HTML FORMS.pptx
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
Html forms
Html formsHtml forms
Html forms
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
 
Html forms
Html formsHtml forms
Html forms
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html basics 10 form
Html basics 10 formHtml basics 10 form
Html basics 10 form
 
HTML_Forms_.ppt
HTML_Forms_.pptHTML_Forms_.ppt
HTML_Forms_.ppt
 
Html form
Html formHtml form
Html form
 
HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lforms
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
 
Introduction To IBM Lotus Forms Viewer
Introduction To IBM Lotus Forms ViewerIntroduction To IBM Lotus Forms Viewer
Introduction To IBM Lotus Forms Viewer
 
html forms
html formshtml forms
html forms
 

More from missstevenson01

Lesson 3 - Coding with Minecraft - Variables.pptx
Lesson 3 -  Coding with Minecraft -  Variables.pptxLesson 3 -  Coding with Minecraft -  Variables.pptx
Lesson 3 - Coding with Minecraft - Variables.pptxmissstevenson01
 
Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxmissstevenson01
 
Lesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxLesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxmissstevenson01
 
Lesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxLesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxmissstevenson01
 
Ethical hacking trojans, worms and spyware
Ethical hacking    trojans, worms and spywareEthical hacking    trojans, worms and spyware
Ethical hacking trojans, worms and spywaremissstevenson01
 
Ethical hacking anti virus
Ethical hacking   anti virusEthical hacking   anti virus
Ethical hacking anti virusmissstevenson01
 
Ethical hacking introduction to ethical hacking
Ethical hacking   introduction to ethical hackingEthical hacking   introduction to ethical hacking
Ethical hacking introduction to ethical hackingmissstevenson01
 
S1 internet safety-chattingonline
S1 internet safety-chattingonlineS1 internet safety-chattingonline
S1 internet safety-chattingonlinemissstevenson01
 
Video Games and Copyright laws
Video Games and Copyright lawsVideo Games and Copyright laws
Video Games and Copyright lawsmissstevenson01
 

More from missstevenson01 (20)

S3 environment
S3 environmentS3 environment
S3 environment
 
The Processor.pptx
The Processor.pptxThe Processor.pptx
The Processor.pptx
 
How Computers Work
How Computers WorkHow Computers Work
How Computers Work
 
Lesson 3 - Coding with Minecraft - Variables.pptx
Lesson 3 -  Coding with Minecraft -  Variables.pptxLesson 3 -  Coding with Minecraft -  Variables.pptx
Lesson 3 - Coding with Minecraft - Variables.pptx
 
Lesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptxLesson 2 - Coding with Minecraft - Events.pptx
Lesson 2 - Coding with Minecraft - Events.pptx
 
Lesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptxLesson 1 - Coding with Minecraft -Introduction.pptx
Lesson 1 - Coding with Minecraft -Introduction.pptx
 
Lesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptxLesson2 - Coding with Minecraft - Events.pptx
Lesson2 - Coding with Minecraft - Events.pptx
 
Ethical hacking trojans, worms and spyware
Ethical hacking    trojans, worms and spywareEthical hacking    trojans, worms and spyware
Ethical hacking trojans, worms and spyware
 
Ethical hacking anti virus
Ethical hacking   anti virusEthical hacking   anti virus
Ethical hacking anti virus
 
Ethical hacking introduction to ethical hacking
Ethical hacking   introduction to ethical hackingEthical hacking   introduction to ethical hacking
Ethical hacking introduction to ethical hacking
 
S1 internet safety-chattingonline
S1 internet safety-chattingonlineS1 internet safety-chattingonline
S1 internet safety-chattingonline
 
S3 wireframe diagrams
S3 wireframe diagramsS3 wireframe diagrams
S3 wireframe diagrams
 
Sql
SqlSql
Sql
 
Alien database
Alien databaseAlien database
Alien database
 
Video Games and Copyright laws
Video Games and Copyright lawsVideo Games and Copyright laws
Video Games and Copyright laws
 
Games Design Document
Games Design DocumentGames Design Document
Games Design Document
 
Video game proposal
Video game proposalVideo game proposal
Video game proposal
 
Evaluation
EvaluationEvaluation
Evaluation
 
H evaluation
H evaluationH evaluation
H evaluation
 
H testing and debugging
H testing and debuggingH testing and debugging
H testing and debugging
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
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
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
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
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
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
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
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 🔝✔️✔️
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

Higher - HTML forms

  • 2. What is a form? The HTML <form> element creates a form that is used to collect user input. It is often used along side PHP and can be used for:  Emailing and contact forms,  Login and Registration,  Searching bars,  Inputting data into an online system  Updating information on a database
  • 3. The Form Tag To create a form in HTML the following tag is used: <form> Form elements </form>
  • 4. Form Elements Text Single line text input <input type=“text”>
  • 5. Form Elements Number Number input like for example age. This can be limited to a range and will prevent the user from entering anything other than a number. <input type=“number”>
  • 6. Form Elements Textarea Used when a paragraph may need to be submitted. Like for example a comment box. <textarea> Enter text here...</textarea>
  • 7. Form Elements Radio Buttons Used when there is multiple options for the user. For example choice of Gender or whether they are a student or a teacher. <input type="radio" > Male <input type="radio" >Female <input type="radio" > Other
  • 8. Form Elements Select - Drop Down Menu Used then there is a list of items to choose from. Select your year: <Select name=“year”> <option value=“S4”> S4 </option> <option value=“S5”> S5 </option> <option value=“S6”> S6 </option> </select>
  • 9. Form Elements Select – Drop down Menu with Size Attribute Select element that will offer a number of options and if it is larger than what is stated then a scroll bar will be given. Select your car: <select size="3“> <option value="volvo">Volvo</option> <option value="nissan">Nissan</option> <option value="ford">Ford</option> <option value="audi">Audi</option> </select>
  • 10. Form Elements Select – Drop down Menu with Size Attribute with multiple choice Select element that will offer a number of options and if it is larger than what is stated then a scroll bar will be given. Select your car: <select size="3“ multiple> <option value="volvo">Volvo</option> <option value="nissan">Nissan</option> <option value="ford">Ford</option> <option value="audi">Audi</option> </select>
  • 11. Form Elements Submit Button When the submit button is pressed the form is submitted and the browser will show any errors to correct or send the details of the form to the server. <input type="submit" value="Submit">
  • 12. Javascript Submit Alerts Javascript can be used to inform a user that they have enter by using the onclick function. <input type="submit" onclick ="alert ('Form Entered')" value="Submit">
  • 13. Pre populated input Form elements can be pre populated to help the user understand what is to be inputted. This can be left unchanged, deleted or even edited by the user. Username: <input type="text" Value="Enter your Username"> <textarea name="comment" > Enter text here... </textarea> <input type="radio" name="gender" value="male" checked> Male
  • 14. Form Validation Length Check Prevents the user from entering more that what is required. <textarea name="comment" maxlength="6">Enter text here...</textarea> The above will prevent the user from entering anything more than 6 characters.
  • 15. Form Validation Presence Check Ensures that the user has entered something in an important field before submitting to the server. Username: <input type="text" Value="Enter your Username" required>
  • 16. Form Validation Range Check Ensures that the user has entered a number that is between a set of numbers <input type="number" name="quantity" min="1" max="5">