Saturday, February 6, 2016

Forms

Forms are using to post Data to one server.  We can target the destination page in FORM tag itself, where the data need to get posted!.  Form required many elements to post the Data like INPUT (text, checkbox, radio), TEXTAREA, SELECT, IMG, etc,

Basically FORM has two types of method to post the data.
1. GET Method
2. POST Method

1. GET Method
By using this method all the data which means all input field TextBox, DropDown, TextArea, Checkbox, Radio button etc., all the values will get clubed together and post in the URL (Target page).  This method is Unsecure and Limitation in terms of URL Length.  We can submit a form with huge data.

When we should not use GET Method?
We should not use in Login, Change Password screen etc., like some confidential data related screen, because if the data is posted in the URL and this will be visible to the user as well as advantage to the hackers.

Simple example, If the data is posted in the URL, this URL stored in browser history.  If you didnt cleared the browse history, other persons can able to see your confidential information and they can do malpractice.

When can we use GET Method? 
We can use GET method where it won't create problem to show some data in the screen.
Example: Pagination, Bread Crumbs, Search result etc.,

2. POST Method
By Using Post method, it is almost similar to GET Method.  Only difference, it will post the data by hidden.  Also there is no restriction to post the data using POST method.  Post data size is Unlimited!!

Source Code:

Output:


Reference for More Details..


No comments:

Popular Posts