Thehtml Form Tag: The Input Elements Go Here....
Thehtml Form Tag: The Input Elements Go Here....
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, etc.) in a form. A form is defined with the <form> tag. The input elements go here....
<FORM> </FORM>
Attri but es
Action Method This Attribute specifies the page which handles the input from the user. Usually, this will be a script or a CGI program which processes the data supplied by the user.
Met hod
METHOD ="GET" | "POST" ( is either GET or POST.) In simple terms, if you use GET method, the input values are passed as part of the URL. If it is POST, the information is sent to the server as part of the data body and will not be visible in the URL box in the user's browser. If you don't specify the method, GET is taken by default.
TextBox Text Field Radio Button Check Box Submit Button Reset Button
Tag Description <form> Defines a form for user input <input> Defines an input field <textarea> Defines a text-area (a multi-line text input control) <label> Defines a label to a control <fieldset> Defines a fieldset <legend> Defines a caption for a fieldset <select> Defines a selectable list (a drop-down box) <optgroup> Defines an option group <option> Defines an option in the drop-down box <button> Defines a push button
Te xt Box
HTML type= text size= maxlength= name= value= align= tabindex= EXPLANATION One line text field Characters shown. Max characters allowed. Name of the field. Initial value in the field. Alignment of the field. Tab order of the field.
<form> <input type="text" name="address" size="30" maxlength="10"> </form> Very similar to the type="text" is the type="password". It is exactly the same, except it displays **** instead of the actual input.
Out put
Exam pl e
<html> <body> <form> Your FeedBack Please : <br><br> <textarea cols="40" rows="5" name="myname"> </textarea> <br><br> Thank You </div> </form> </body> </html>
CheckBox
<html> <body> <form> I have a bike: <input type="checkbox" name="vehicle" value="Bike" checked> I have a car: <input type="checkbox" name="vehicle" value="Car"> <br> I have an airplane: <input type="checkbox" name="vehicle" value="Airplane"> </form> </body> </html>
Drop D ow n Menu
<html> <body> <form action=""> <select name="Language"> <option <option <option <option </select> </form> </body> </html> value="C">C</option> value="C++">C++</option> value="Java">Java</option> value="VB">VB</option>
After entering the data, the user presses the submit button which triggers the browser to send the data to the server. You can add a submit button to the form using the 'submit' input type. You can add a submit button to your html form using the following code