OneStopTesting.com - Testing EBooks, Tutorials, Articles, Jobs, Training Institutes etc.
OneStopGate.com - Gate EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopMBA.com - MBA EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopIAS.com - IAS EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopSAP.com - SAP EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopGRE.com - of GRE EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
Forms in HTML 1 | Articles | Recent Articles | News Article | Interesting Articles | Technology Articles | Articles On Education | Articles On Corporate | Company Articles | College Articles | Articles on Recession
Home » Articles » Forms in HTML 1
Forms in HTML 1
Article Posted On Date : Thursday, March 22, 2012
Forms in HTML 1
Advertisements
Forms add the ability to web pages to not only provide the person viewing the document with dynamic information but also to obtain information from the person viewing it, and process that information. A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, select, drop down list etc.) in a form. To insert a form we use the <form>...</form> tags. The rest of the form elements must be inserted in between the form tags. NOTE: The FORM element has no formatting attributes. Text Area Textarea is an element that allows for free form text entry. <TEXTAREA> </TEXTAREA> Textarea has the following attributes: NAME: is the name of the variable. ROWS: the number of rows to the textbox. COLS: the number of columns to the textbox. HTML code for TEXT AREA: html> <head> <title>Forms in HTML</title> </head> <body> <form name="input" action="html_form_submit.asp" method="get"> <br> Please enter something about yourself:<br> <textarea rows="5" name="textareaBox" cols="50">Write something</textarea></p> </form> </body> </html> Select The two following examples are <SELECT> </SELECT> elements, where the attributes are set differently. <SELECT> </SELECT> The Select element's attributes are: NAME: is the name of the variable. SIZE: This sets the number of visible choices. MULTIPLE: The presence of this attribute signifies that the user can make multiple selections. By default only one selection is allowed. HTML code for SELECT: html> <head> <title>Forms in HTML</title> </head> <body> <form name="input" action="html_form_submit.asp" method="get"> <p>Select country where you worked:</p> <p><select size="3" name="country" multiple> <option selected>India</option> <option>United States</option> <option>Germany</option> <option>China</option> <option>Pakistan</option> <option>Australia</option> <option>Sri Lanka</option> <option>Canada</option> </select></p> </form> </body> </html> Drop Down List The drop down selection list is an element of HTML forms. It consists of a set of options along with their associated values and some text. This text (not the value) is displayed in the drop down selection list. HTML code for DROP DOWN LIST: html> <head> <title>Forms in HTML</title> </head> <body> <form name="input" action="html_form_submit.asp" method="get"> <p>Enter your book interest<br> <SELECT NAME="mylist"> <OPTION VALUE="m1">Cape Fear <OPTION VALUE="m2">The Good, the Bad and the Ugly <OPTION VALUE="m3">The Omen <OPTION VALUE="m4">The Godfather <OPTION VALUE="m5">Forrest Gump </SELECT> </p> </form> </body> </html> You can use all the form fields in a single html webpage. The code for the same is given below. <html> <head> <title>Forms in HTML</title> </head> <body> <br> Please enter something about yourself:<br> <textarea rows="5" name="textareaBox" cols="50">Write something</textarea></p> <p>Select country where you worked: <p><select size="3" name="country" multiple> <option selected>India</option> <option>United States</option> <option>Germany</option> <option>China</option> <option>Pakistan</option> <option>Australia</option> <option>Sri Lanka</option> <option>Canada</option> </select></p> <p>Enter your book interest<br> <SELECT NAME="mylist"> <OPTION VALUE="m1">VB.NET <OPTION VALUE="m2">C#.NET <OPTION VALUE="m3">Microsoft SQL Server <OPTION VALUE="m4">HTML Coding <OPTION VALUE="m5">GUI Programming </SELECT> </p> </form> </form> </body> </html> You can simply copy paste the code in the notepad and save as with some name and extension as "html" or "htm" and see the effect on your browser. Hope the article would have helped you making a grasp on html coding. I will be explaining more about HTML forms in my next article. So be inline.
Amazon.in Widgets