SlideShare a Scribd company logo
HTML Forms and Frames
HTML Forms
Entering User Data from a Web Page
What are HTML Forms?
• The primary method for gathering data from site
visitors
• HTML Forms can contain
• Text fields for the user to type
• Buttons for interactions like
"Register", "Login", "Search"
• Menus, Sliders, etc…
• For example: If a user want to purchase some items on internet,
he/she must fill the form such as shipping address and credit/debit
card details so that item can be sent to the given address.
3
How to Create a HTML Form?
• Create a form block with
• Example:
4
<form></form>
<form name="myForm" method="post"
action="path/to/some-script.php">
...
</form> The "action" attribute tells where
the form data should be sent
The "method" attribute tells how
the form data should be sent – via
GET or POST request
It is a container element started by <form> tag and ended
by </form>tag
The “name" attribute specifies the name of the form.
The NAME attribute is optional if there is only one FORM on the web page.
How to Create a HTML Form?
• Create a form block with
• Example:
5
<form></form>
<form name="myForm" method="post"
action="path/to/some-script.php">
...
</form>
The "action" attribute tells where
the form data should be sent
The "method" attribute tells how
the form data should be sent – via
GET or POST request
It is a container element started by <form> tag and ended
by </form>tag
INPUT ELEMENT
• INPUT FIELDS
• Fieldsets
• Text Boxes,password
• Buttons,Submit,Reset
• Checkboxes and Radio Buttons
• Select Fields
• Image ,Hidden ,File
Syntax:
<INPUT TYPE = “FIELD TYPE” NAME = “FIELD NAME”
VALUE = “FIELD TEXT”> 6
- It is an empty element specified by tag.
- It is used to provide an input field in a form
where the user can enter the data.
Attributes of INPUT element-Text Fields
• Single-line text input fields:
• Multi-line text input fields (textarea):
• Password input – a text field which masks the
entered text with * signs
7
<input type="text" name="FirstName" value="This
is a text field" />
<textarea name="Comments">This is a multi-line
text field</textarea>
<input type="password" name="pass" />
Attributes of TEXT FIELDS,PASSWORD
8
NAME
Specifies the name of the field. This name does not appear on the
FORM. It is required for the identification/ differentiation as there
can be more than one fields in a single FORM.
Syntax: NAME = "FieldName"
VALUE
Specifies the text to be displayed on the field.
Syntax:VALUE = "FieldText“
SIZE
Sets the visible size of the text field to n characters.
Syntax: SIZE = “n“
MAXLENGTH
- Set the maximum number of characters that can be input in the
text field to n.
Syntax: maxlength=“n“
Buttons
• Reset button – brings the form to its initial state
• Submit button: Submitted to the destination file.
• Image button – acts like submit but image is
displayed and click coordinates are sent
• Ordinary button – no default action, used with JS
9
<input type="reset" name="resetBtn"
value="Reset the form" />
<input type="image" src="submit.gif"
name="submitBtn" alt="Submit" />
<input type="button" value="click me" />
<input type="submit" value="Apply Now" />
Checkboxes and Radio Buttons
• Checkboxes used to choose more than one option.
• Radio buttons :
• Radio buttons can be grouped, allowing only one to
be selected from a group:
10
<input type="checkbox" name="fruit"
value="apple" />
<input type="radio" name="title" value="Mr." />
<input type="radio" name="city" value="Lom" />
<input type="radio" name="city" value="Ruse" />
Attributes -Checkboxes and Radio
Buttons
11
<input type="radio" name="city" value="Lom“ checked/>
<input type="radio" name="city" value="Ruse" />
CHECKED - Indicates that the radio button is selected, which
can be deselected when another choice is made. At one time,
only one radio button in a radio group can be specified as
CHECKED.
CHECKED - Indicates that the checkbox is to be displayed with a tick
mark to show selection.This attribute is optional
<input type="checkbox" name="vehicle" value="Bike"> I have a
bike<br>
<input type="checkbox" name="vehicle" value="Car" checked>
I have a car<br>
Select Fields
• Dropdown menus:
• Multiple-choice menus
12
<select name="gender">
<option value="Value 1"
selected="selected">Male</option>
<option value="Value 2">Female</option>
<option value="Value 3">Other</option>
</select>
<select name="products" multiple="multiple">
<option value="Value 1"
selected="selected">keyboard</option>
<option value="Value 2">mouse</option>
</select>
Hidden Fields
• Hidden fields contain invisible data
• Not shown to the user
• Used by JavaScript and server-side code
13
<input type="hidden" name="Account"
value="This is a hidden text field" />
Fieldsets
• Fieldsets are used to enclose a group of related form
fields:
• The <legend> is the fieldset's title
14
<form method="post" action="form.aspx">
<fieldset>
<legend>Client Details</legend>
<input type="text" id="Name" />
<input type="text" id="Phone" />
</fieldset>
<fieldset>
<legend>Order Details</legend>
<input type="text" id="Quantity" />
<textarea cols="40" rows="10"
id="Remarks"></textarea>
</fieldset>
</form>
FIELDSETS Eg.
IE8
HTML FORMS -EXAMPLE
16
<html>
<head><tiitle>Form Example</title></head>
<body bgcolor="#CCFF66">
<form align="center">
<h3 >Personal Details</h3>
Name: <input type="text" name="name" ><br><br>
Password:<input type="password" name="password" ><br><br>
E-mail id: <input type="text" name="name" ><br><br>
Gender: <input type="radio" name="radiogroup1" value="radio" > Male
<input type="radio" name="radiogroup1" value="radio" > Female<br><br>
Contact#: <input type="text" name="mobile" id="mobile">
<h3 >Educational Qualification</h3>
Degree: <select name="degree">
<option selected>-- Select Group --</option>
<option>B.Com</option>
<option>B.sc</option>
<option>B.com Computers</option>
<option>B.A</option>
</select><br> 17
Engineering: <select name="eng" >
<option selected>-- Select Group --</option>
<option>CSE</option>
<option>ECE</option>
<option>CIVIL</option>
<option>EEE</option>
</select><br><br>
Hobbies: <input type="checkbox" name="CheckboxGroup1“>Playing chess
<input type="checkbox" name="CheckboxGroup1" value="checkbox" >Reading
Books<br><br>
<h3 >Address</h3>
<textarea name="textarea" cols="35" rows="5" ></textarea><br><br>
Attch Resume: <input type="file" name="fileField" ><br>
<input type="image" src="/images/submit_btn.png">
</form>
</body>
</html>
18
HTML Frames
<frameset>, <frame> and <iframe>
HTML Frames
• Frames provide a way to show multiple HTML documents
in a single Web page
• The page can be split into separate views (frames)
horizontally and vertically
• Frames were popular in the early ages of HTML
development, but now their usage is rejected
• Frames are not supported by all user agents (browsers,
search engines, etc.)
20
HTML Frames – Demo
21
<html>
<head><title>Frames Example</title></head>
<frameset cols="180px,*,150px">
<frame src="left.html" />
<frame src="middle.html" />
<frame src="right.html" />
</frameset>
</html>
22
23
24
25
IFRAME
Inline Frames: <iframe>
• Inline frames provide a way to show one website
inside another website:
26
<iframe name="iframeGoogle" width="600" height="400"
src="http://www.google.com" frameborder="yes"
scrolling="yes"></iframe>
27
Syntax:
<iframe src= “ “ height=200 width = 200 ></iframe>
28
29
Homework (1)
1. Create a Web form
that looks like this
sample:
30
Homework (2)
2. Create the following using tables and forms:
31
Homework (3)
3. Construct the following Grid component:
• Try to make a HTML page, that looks just like the example
32
Homework (4)
4. *Create the following HTML Page
• Hint: Use Fieldsets and Nested tables
33

More Related Content

Similar to Forms,Frames.ppt

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
Maitree Patel
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
Mike Crabb
 
Html forms
Html formsHtml forms
Html forms
KoreshPadhi
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
Steve Guinan
 
Lecture-5.pptx
Lecture-5.pptxLecture-5.pptx
Lecture-5.pptx
vishal choudhary
 
18servers And Forms
18servers And Forms18servers And Forms
18servers And Forms
Adil Jafri
 
Lectures-web
Lectures-webLectures-web
Lectures-web
The Great Travel
 
Forms
FormsForms
Forms
FormsForms
Forms
myrajendra
 
Html forms
Html formsHtml forms
Html forms
nobel mujuji
 
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
shereifhany
 
Html class-04
Html class-04Html class-04
Html class-04
Md Ali Hossain
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
Gene Babon
 
Higher - HTML forms
Higher - HTML formsHigher - HTML forms
Higher - HTML forms
missstevenson01
 
Html forms
Html formsHtml forms
Html basics 10 form
Html basics 10 formHtml basics 10 form
Html basics 10 form
H K
 
Html Form Controls
Html Form ControlsHtml Form Controls
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Abhishek Kesharwani
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptx
SALT13
 
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
Mudasir Syed
 

Similar to Forms,Frames.ppt (20)

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
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
 
Html forms
Html formsHtml forms
Html forms
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Lecture-5.pptx
Lecture-5.pptxLecture-5.pptx
Lecture-5.pptx
 
18servers And Forms
18servers And Forms18servers And Forms
18servers And Forms
 
Lectures-web
Lectures-webLectures-web
Lectures-web
 
Forms
FormsForms
Forms
 
Forms
FormsForms
Forms
 
Html forms
Html formsHtml forms
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 class-04
Html class-04Html class-04
Html class-04
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
 
Higher - HTML forms
Higher - HTML formsHigher - HTML forms
Higher - 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 Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Tables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptxTables and their padding in HTML etc.pptx
Tables and their padding in HTML etc.pptx
 
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
 

More from MaheShiva

ppt Ncsc.pptx
ppt Ncsc.pptxppt Ncsc.pptx
ppt Ncsc.pptx
MaheShiva
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
MaheShiva
 
Number System[HEXADECIMAL].pptx
Number System[HEXADECIMAL].pptxNumber System[HEXADECIMAL].pptx
Number System[HEXADECIMAL].pptx
MaheShiva
 
004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf
MaheShiva
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptx
MaheShiva
 
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
MaheShiva
 

More from MaheShiva (6)

ppt Ncsc.pptx
ppt Ncsc.pptxppt Ncsc.pptx
ppt Ncsc.pptx
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Number System[HEXADECIMAL].pptx
Number System[HEXADECIMAL].pptxNumber System[HEXADECIMAL].pptx
Number System[HEXADECIMAL].pptx
 
004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf
 
Algorithm and flowchart.pptx
Algorithm and flowchart.pptxAlgorithm and flowchart.pptx
Algorithm and flowchart.pptx
 
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
 

Recently uploaded

LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
DakshGudwani
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
lhtvqoag
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
qo1as76n
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
bo44ban1
 
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdfADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
GregMichaelTapawan
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
qo1as76n
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
hw2xf1m
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
Virtual Real Design
 
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build  Your Online Presence 2024.pptxBest Digital Marketing Strategy Build  Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
pavankumarpayexelsol
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
k4krdgxx
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
wkip62b
 
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
yufen5
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
anthonylin333
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
ellemjani
 
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
21uul8se
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
kuapy
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
9lq7ultg
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 

Recently uploaded (20)

LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
 
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdfADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
 
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build  Your Online Presence 2024.pptxBest Digital Marketing Strategy Build  Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
 
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
 
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 

Forms,Frames.ppt

  • 1. HTML Forms and Frames
  • 2. HTML Forms Entering User Data from a Web Page
  • 3. What are HTML Forms? • The primary method for gathering data from site visitors • HTML Forms can contain • Text fields for the user to type • Buttons for interactions like "Register", "Login", "Search" • Menus, Sliders, etc… • For example: If a user want to purchase some items on internet, he/she must fill the form such as shipping address and credit/debit card details so that item can be sent to the given address. 3
  • 4. How to Create a HTML Form? • Create a form block with • Example: 4 <form></form> <form name="myForm" method="post" action="path/to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent The "method" attribute tells how the form data should be sent – via GET or POST request It is a container element started by <form> tag and ended by </form>tag The “name" attribute specifies the name of the form. The NAME attribute is optional if there is only one FORM on the web page.
  • 5. How to Create a HTML Form? • Create a form block with • Example: 5 <form></form> <form name="myForm" method="post" action="path/to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent The "method" attribute tells how the form data should be sent – via GET or POST request It is a container element started by <form> tag and ended by </form>tag
  • 6. INPUT ELEMENT • INPUT FIELDS • Fieldsets • Text Boxes,password • Buttons,Submit,Reset • Checkboxes and Radio Buttons • Select Fields • Image ,Hidden ,File Syntax: <INPUT TYPE = “FIELD TYPE” NAME = “FIELD NAME” VALUE = “FIELD TEXT”> 6 - It is an empty element specified by tag. - It is used to provide an input field in a form where the user can enter the data.
  • 7. Attributes of INPUT element-Text Fields • Single-line text input fields: • Multi-line text input fields (textarea): • Password input – a text field which masks the entered text with * signs 7 <input type="text" name="FirstName" value="This is a text field" /> <textarea name="Comments">This is a multi-line text field</textarea> <input type="password" name="pass" />
  • 8. Attributes of TEXT FIELDS,PASSWORD 8 NAME Specifies the name of the field. This name does not appear on the FORM. It is required for the identification/ differentiation as there can be more than one fields in a single FORM. Syntax: NAME = "FieldName" VALUE Specifies the text to be displayed on the field. Syntax:VALUE = "FieldText“ SIZE Sets the visible size of the text field to n characters. Syntax: SIZE = “n“ MAXLENGTH - Set the maximum number of characters that can be input in the text field to n. Syntax: maxlength=“n“
  • 9. Buttons • Reset button – brings the form to its initial state • Submit button: Submitted to the destination file. • Image button – acts like submit but image is displayed and click coordinates are sent • Ordinary button – no default action, used with JS 9 <input type="reset" name="resetBtn" value="Reset the form" /> <input type="image" src="submit.gif" name="submitBtn" alt="Submit" /> <input type="button" value="click me" /> <input type="submit" value="Apply Now" />
  • 10. Checkboxes and Radio Buttons • Checkboxes used to choose more than one option. • Radio buttons : • Radio buttons can be grouped, allowing only one to be selected from a group: 10 <input type="checkbox" name="fruit" value="apple" /> <input type="radio" name="title" value="Mr." /> <input type="radio" name="city" value="Lom" /> <input type="radio" name="city" value="Ruse" />
  • 11. Attributes -Checkboxes and Radio Buttons 11 <input type="radio" name="city" value="Lom“ checked/> <input type="radio" name="city" value="Ruse" /> CHECKED - Indicates that the radio button is selected, which can be deselected when another choice is made. At one time, only one radio button in a radio group can be specified as CHECKED. CHECKED - Indicates that the checkbox is to be displayed with a tick mark to show selection.This attribute is optional <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car" checked> I have a car<br>
  • 12. Select Fields • Dropdown menus: • Multiple-choice menus 12 <select name="gender"> <option value="Value 1" selected="selected">Male</option> <option value="Value 2">Female</option> <option value="Value 3">Other</option> </select> <select name="products" multiple="multiple"> <option value="Value 1" selected="selected">keyboard</option> <option value="Value 2">mouse</option> </select>
  • 13. Hidden Fields • Hidden fields contain invisible data • Not shown to the user • Used by JavaScript and server-side code 13 <input type="hidden" name="Account" value="This is a hidden text field" />
  • 14. Fieldsets • Fieldsets are used to enclose a group of related form fields: • The <legend> is the fieldset's title 14 <form method="post" action="form.aspx"> <fieldset> <legend>Client Details</legend> <input type="text" id="Name" /> <input type="text" id="Phone" /> </fieldset> <fieldset> <legend>Order Details</legend> <input type="text" id="Quantity" /> <textarea cols="40" rows="10" id="Remarks"></textarea> </fieldset> </form>
  • 17. <html> <head><tiitle>Form Example</title></head> <body bgcolor="#CCFF66"> <form align="center"> <h3 >Personal Details</h3> Name: <input type="text" name="name" ><br><br> Password:<input type="password" name="password" ><br><br> E-mail id: <input type="text" name="name" ><br><br> Gender: <input type="radio" name="radiogroup1" value="radio" > Male <input type="radio" name="radiogroup1" value="radio" > Female<br><br> Contact#: <input type="text" name="mobile" id="mobile"> <h3 >Educational Qualification</h3> Degree: <select name="degree"> <option selected>-- Select Group --</option> <option>B.Com</option> <option>B.sc</option> <option>B.com Computers</option> <option>B.A</option> </select><br> 17
  • 18. Engineering: <select name="eng" > <option selected>-- Select Group --</option> <option>CSE</option> <option>ECE</option> <option>CIVIL</option> <option>EEE</option> </select><br><br> Hobbies: <input type="checkbox" name="CheckboxGroup1“>Playing chess <input type="checkbox" name="CheckboxGroup1" value="checkbox" >Reading Books<br><br> <h3 >Address</h3> <textarea name="textarea" cols="35" rows="5" ></textarea><br><br> Attch Resume: <input type="file" name="fileField" ><br> <input type="image" src="/images/submit_btn.png"> </form> </body> </html> 18
  • 20. HTML Frames • Frames provide a way to show multiple HTML documents in a single Web page • The page can be split into separate views (frames) horizontally and vertically • Frames were popular in the early ages of HTML development, but now their usage is rejected • Frames are not supported by all user agents (browsers, search engines, etc.) 20
  • 21. HTML Frames – Demo 21 <html> <head><title>Frames Example</title></head> <frameset cols="180px,*,150px"> <frame src="left.html" /> <frame src="middle.html" /> <frame src="right.html" /> </frameset> </html>
  • 22. 22
  • 23. 23
  • 24. 24
  • 26. Inline Frames: <iframe> • Inline frames provide a way to show one website inside another website: 26 <iframe name="iframeGoogle" width="600" height="400" src="http://www.google.com" frameborder="yes" scrolling="yes"></iframe>
  • 27. 27 Syntax: <iframe src= “ “ height=200 width = 200 ></iframe>
  • 28. 28
  • 29. 29
  • 30. Homework (1) 1. Create a Web form that looks like this sample: 30
  • 31. Homework (2) 2. Create the following using tables and forms: 31
  • 32. Homework (3) 3. Construct the following Grid component: • Try to make a HTML page, that looks just like the example 32
  • 33. Homework (4) 4. *Create the following HTML Page • Hint: Use Fieldsets and Nested tables 33

Editor's Notes

  1. 07/16/96
  2. 07/16/96
  3. 07/16/96
  4. 07/16/96
  5. 07/16/96
  6. 07/16/96
  7. 07/16/96
  8. 07/16/96
  9. 07/16/96
  10. 07/16/96