Forms
-
Upload
biswadip-goswami -
Category
Technology
-
view
543 -
download
0
Transcript of Forms
![Page 1: Forms](https://reader035.fdocuments.us/reader035/viewer/2022080213/55a2486f1a28ab9f2b8b46ac/html5/thumbnails/1.jpg)
FORMS in HTML
![Page 2: Forms](https://reader035.fdocuments.us/reader035/viewer/2022080213/55a2486f1a28ab9f2b8b46ac/html5/thumbnails/2.jpg)
An HTML form is a section of a document containing normal content, markup, special elements called controls (checkboxes, radio buttons, menus, etc.), and labels on those controls.
Users generally "complete" a form by modifying its controls (entering text, selecting menu items, etc.), before submitting the form to an agent for processing (e.g., to a Web server, to a mail server, etc.)
![Page 3: Forms](https://reader035.fdocuments.us/reader035/viewer/2022080213/55a2486f1a28ab9f2b8b46ac/html5/thumbnails/3.jpg)
<FORM action="http://somesite.com/prog/adduser" method="post"> <P> <LABEL for="firstname">First name: </LABEL> <INPUT type="text" id="firstname"><BR> <LABEL for="lastname">Last name: </LABEL> <INPUT type="text" id="lastname"><BR> <LABEL for="email">email: </LABEL> <INPUT type="text" id="email"><BR> <INPUT type="radio" name="sex" value="Male"> Male<BR> <INPUT type="radio" name="sex" value="Female"> Female<BR> <INPUT type="submit" value="Send"> <INPUT type="reset"> </P> </FORM>
![Page 4: Forms](https://reader035.fdocuments.us/reader035/viewer/2022080213/55a2486f1a28ab9f2b8b46ac/html5/thumbnails/4.jpg)
• Users interact with forms through named controls.
• HTML defines the following control types: – buttons – checkboxes – radio buttons – menus – text input – file select – hidden controls – object controls
![Page 5: Forms](https://reader035.fdocuments.us/reader035/viewer/2022080213/55a2486f1a28ab9f2b8b46ac/html5/thumbnails/5.jpg)
This example creates a TEXTAREA control that is 20 rows by 80 columns and contains two lines of text initially. The TEXTAREA is followed by submit and reset buttons.
<FORM action="http://somesite.com/prog/text-read" method="post"> <P> <TEXTAREA name="thetext" rows="20" cols="80"> First line of initial text. Second line of initial text. </TEXTAREA> <INPUT type="submit" value="Send"><INPUT type="reset"> </P> </FORM>