Form: Registration form basically used for registration purpose. Its process start with the <form> tag. In form tag there is various attributes are used, by which input are process. In Form tag, input tag are used which occupy the “type” attribute, in type attribute put the values like: text, password, email, textarea, radio, checkbox, Tel, Email, Date etc.

Text: This value is used when user want to fill the text information example: name of the user. There are an another attribute placeholder can also be used. Placeholder is a value that is display in input field whenever it is empty. You can also apply pattern attribute in text field by which validation can be put .

Example: <input type=”text”  pattern=”[A-Za-z]{3}” placeholder=”Fill the name”>

Here [A-Za-z] define that it contain only alphabet not any number or special character,

{3} define that it accept only three alphabet not more than that.

Password: This value is used when type a password, by using this password are filled in a secure way rather than in a text form. Placeholder can also be used here.

Example: <input type=”password”  pattern=”.{8,}” placeholder=”Fill the password”>

Maxlength: It define about the maximum number of character in the input field.

Minlength: It define about the minimum number of character in the input field.

Size: It define about the how many characters wide the input field.User can apply all these attributes in input field

Example:<input type=”text”  Maxlength =”9″ Minlength =”5″ size=”10” placeholder=”Fill the text”>

Radio: It is basically used for the selection of gender. Radio button presented in a radio group, in a radio group only one button can be selected between two button. In radio type there is an another attribute “name” is also used. The radio group share the same name.

Checkbox: In which multiple selection can be possible. Checkbox is shown as a square box. When that checkbox is activated at that time ,it is marked as a tick.

Textarea: It is used for unlimited length of text. This textarea element create a text input area of unlimited length. In which rows and cols attribute is also used which define about the area of the textarea. This is used to enter an address.

Email: This attribute is used so that user enter an email address. In which email input format automatically validated that it is in proper format or not.

Tel: It define about a field for enter a telephone number.

Example: <input type=”tel” placeholder=”Contact No” pattern=”[0-9]{3}-[0-9]{2}-[0-9]{3}”>

Here =”[0-9]{3}-[0-9]{2}-[0-9]{3}”> define the format as:456-67-789.Means in first you need to enter three number then enter two number after that enter three number.

Date: This attribute is used whenever user want to enter a date. This specify about the Date format.

Submit: This is used for submission purpose. When user click on this submit button then form is submit.

Action: Action attribute in form tag specify where that particular form data to be sent after the submission of form. It specify the URL of the document.

For styling uses a CSS Properties by using style attribute, in which uses a property like font-size, height, width.

Program:

 

 

(Visited 91 times, 1 visits today)
Share with Friends :