CS118-Web Engineering (D, E ) 2019 Sir Syed University of ...



LAB SESSION 4Object: To study about an HTML Form Structure, Controls & its type, Text Input Controls, Checkboxes Controls, Radio Box Controls, Select Box Controls, File Select boxes, Hidden Controls, Clickable Buttons, Submit and Reset Button and Designing HTML FormsHTML Form:An HTML form on a web page usually comprises a set of input fields for the user to fill in and submit to the website. HTML defines a tag, <form>, which is used to place a form on a page. Within the form you can place <input>, <select> and other tags to obtain data from the user. There are several types of widgets that can be placed on a form to obtain user input, including text fields, radio buttons, check boxes and drop down boxes. A form is usually submitted by clicking on a submit button, but can often also be submitted by pressing enter when editing one of the fields.The form tag has an attribute called "action" which is used to specify where the form will post the contents of its fields to. Another attribute of the form tag is "method", which can take the values "get" and "post". When using the "get" method, the values in the form fields are appended to the URL of the target. When using the "post" method, the values are passed in the header of the request to the server and will not be visible on the URL. The main difference between a HTML form and a regular HTML document is that most of the time, the data collected by the form is sent to a web server. In that case, you need to set up a web server to receive and process the data.?The?<form>?element formally defines a form and attributes that determine the behavior of this form. Each time you want to create an HTML form, you must start it by using this element, putting all the contents inside. Many assistive technologies or browser plugins can discover?<form>?elements and implement special hooks to make them easier to use.Syntax:<form action="/action_page.php" method=”post”>All of its attributes are optional but it's considered best practice to always set at least the?action?attribute and the?method?attribute.The?action?attribute defines the location (URL) where the form's collected data should be sent when it is submitted.The?method?attribute defines which HTTP method to send the data with (it can be "get" or "post").Example:<ahref="">Sir Syed University of Engineering & Technology Website</a>EXAMPLE<html><body><form>Name: <input type="text" name="name" /><br /><br />E-mail: <input type="text" name="name" /><br /><br /><input type="reset" value="Reset" /></form><p>Enter some data into the form, then click the Reset button to reset it.</p></body></html>ExercisesNote: Every CODE & Output should contain your ROLL Number for copyright.Create facebook sign up page.Create following page. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download