pdf and assignemnt\6th day form
pdf and assignemnt\6th day form
CNCWEBWORLD
Topic:Form
Trainer –
Shilpa Nikhare
FORM
The HTML <form> tag is used to create a form
on a web page that has interactive controls for
user input. This tag is also commonly referred to
as the <form> element.
Forms are required when you want to collect
some data from the site visitor. For example
registration information: name, email address,
credit card, etc.
A form will take input from the site visitor and
then will post your back-end application
FORM
Form elements are like text fields, textarea fields,
drop-down menus, radio buttons, checkboxes, etc.
which are used to take information from the user
Syntax:
o Button Type:
When you use the <input> element to create a
button, the type of button you create is specified
using the type attribute. The type attribute can
take the following values:
1.Submit
2.Reset
3.Button
FORM
Submit: This creates a button that automatically
submits a form.
<input type=“submit" value="Hello world!">
o Reset: This creates a button that automatically resets
form controls to their initial values.
<input type=“reset" value="Hello world!">
Button: This creates a button that is used to trigger a
client-side script when the user clicks that button
<input type=“button” value="Hello world!">
o Button Elements
<button type="submit“name="submit">Submit</button>
FORM
Method
The method attribute specifies how to send form-data,
GET:
Appends form-data into the URL in name/value pairs
The length of a URL is limited (about 3000 characters)
Never use GET to send sensitive data! (will be visible in the
URL)
GET is better for non-secure data, like query strings in
Google.
POST:
Appends form-data inside the body of the HTTP
request (data is not shown is in URL)
Has no size limitations
FORM
Radio Buttons are used when only one option is
required to be selected.
type: Indicates that you want to create a radio box
name: Name of the control.
value: Used to indicate the value that will be sent to
the server if this option is selected.
checked: Indicates that this option should be selected
by default when the page loads.
Syntax
<fieldset>
<legend>Personal Information:</legend>
</fieldset>
FORM
Hidden Form Controls
Hidden form controls are used to hide data inside the
page which later on can be pushed to the server.
Syntax
<input type="hidden" name="fname" >
ASSIGNMNET
Example :1
ASSIGNMENT
Example :2
ASSIGNMENT
Example :3
ASSIGNMENT
Example :4
ASSIGNMENT
Example :4