Form Tag
Form Tag in HTML : form tag is used to submit the values to server.
Attributes of form tag :
- Id : id of the form tag.
- Name : name of the form tag.
- *method :it specify how to send the form data to server.
Popular methods are : GET, POST.
Difference Between GET and POST menthods.
GET
|
POST
|
Action : When user submitting the form, form values submitted through this page.
ENC Type : It is used to allow binary formatted text or plain formatted text.
Sub tag’s of form tags :
Field set (<field set>) : It writes a frame for form elements.
Legend (<legend>) : It writes the name of the filed set , it display on the line.
Label (<label>) : It specify a label for form element.
Example :
- <label for=“element id”>label</label>
- <fieldset>
<label for=“x”>user</label>
<input type=“text” id=“x”>
</fieldset>
Input tag in HTML (<input>) : It writes ten types of form elements, but default elements is text box.
Attributes of input tag :
- Type : It written the input elements, elements are
- Text
- Password
- Hidden
- Submit
- Button
- Reset
- File
- Check box
- Radio
- Image
Text type in HTML (<type=“text”>) : It written a text box and text box allow 256 characters, modern browsers are allowing 65,536(64kb).
Attributes of type=“text”
- Id : id of the text box
- Name : name of the text box
- *value : default value in text box
- size : increase the width of the text box
- max length : max number of characters entered into text box.
- Disabled : disable the text box
- Read only : it is used to read the content only, but not write the content.
- Auto complete : on/off-it shows the previous text data or not.
Example for text box :
<input type= “text” id=“name” name=“name” value=“enter” size=“60” max length=“5” readonly=“true” autocomplete=“on”>
Password type in HTML (<type= “password”>) : It is also written a text box but data will apper in password format.
Example : <input type= “password”>
Hidden type in HTML (<type=“hidden”>) : It written a text box in hidden format, the attributes of text ,password are hidden is same.
Example for hidden type :
<input type= “hidden” id=“name” name=“name” value=“enter”>
Submit type in HTML (<type=“submit”>): It is used to submit the for, data to server.
Example for submit type :
<input type= “submit” id=“name” name=“name” value=“enter”>
Reset type in HTML (<type=“reset”>): It is used to reset the form or reload a new form, the attribute of submit and reset is same.
Example for reset type: <input type= “reset” id=“name” name=“name” value=“enter”/>
Button type in HTML : This button don’t have any specified nature, we will provide the nature using java script and jquary.
Example for button type: <input type= “button” id=“name” name=“name” value=“enter”/>
Check box type in HTML (<type=“checkbox”>): It returns a check box.
Attributes of check box :
- Id : name
- Value : value of the check box
- Checked : it is used to check checkbox automatically
Example for check box type :
<input type= “checkbox” id=“name” name=“name” value=“enter” checked= “true”/>
Radio type in HTML (<type=“radio”>) : It written a radio button with in the form elements.
Example for radio type :
<input type= “radio” id=“name” name=“gender” value=“male” checked= “true”>male
<input type= “radio” id=“name” name=“gender” value=“female” >female
Browse Button in HTML (<type=“file”>) : It is used to browse and upload the files from system.
Example for file type :
<input type= “file” id=“name” name=“gender” accept=“image/*” multiple/>
Note : Multiple is used to accept multiple file upload in single browse buttom.
Image type in HTML (<type=“file”>) : It is used to upload images.
Example for image type :
<input type= “image” src=“.jpg” wodth=“500px” height=“500px”>
No comments:
Post a Comment