html forms the text object presented by: ankit gupta
DESCRIPTION
The Tag ” type=“TEXT” value=“ ”> It defines a form control for the user to enter input. Common input objects used are: Text Text Area Radio Button Check Box ButtonsTRANSCRIPT
![Page 1: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/1.jpg)
HTML FORMSThe TEXT Object
Presented By:Ankit Gupta
![Page 2: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/2.jpg)
HTML Forms HTML Forms provides data gathering functionality
to a webpage. They provide a full range of GUI controls. They collect data using different controls and
submit it to the web server. Tag used:
<form>…</form>
![Page 3: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/3.jpg)
The <INPUT> Tag<input name=“<NameOfTheObject>” type=“TEXT” value=“<DefaultValue>”>
It defines a form control for the user to enter input.
Common input objects used are: Text Text Area Radio Button Check Box Buttons
![Page 4: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/4.jpg)
The TEXT Object It defines the input type as text.
<input type=“text”> Text objects are data entry fields. They accept a single line of text entry. The input text entry is submitted to the web server. The information is usually processed through a
server side scripting language such as PERL, PHP, ASP, etc.
![Page 5: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/5.jpg)
TEXT AttributesSIZE
It defines the width of the text field. That is how many visible characters it can contain.
![Page 6: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/6.jpg)
TEXT AttributesMAXLENGTH
It defines the maximum length of the text field. That is how many characters can be entered in the
field. If you do not specify a maxlength, the user can
easily enter more characters than that are visible in the field at one time.
![Page 7: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/7.jpg)
TEXT AttributesNAME
It adds an internal name to the field. It makes each element unique So that the program that handles the form can easily
identify the fields.VALUE
It defines a default value to appear in the text box
![Page 8: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/8.jpg)
TEXT AttributesALIGN
It defines how the fields is aligned. Valid alignments are:
TOP MIDDLE BOTTOM RIGHT LEFT
![Page 9: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/9.jpg)
TEXT AttributesTABINDEX
It defines the order in which the different fields should be activated when the visitor clicks the TAB key.
![Page 10: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/10.jpg)
JavaScript EventsJavaScript provides the following event handlers for the text element’s events:
onFocus() – Fires when the form cursor enters into the textbox.
onBlur() – Fires when the form cursor is moved away from the textbox.
onSelect() – Fires when the text is selected in the textbox.
onChange() – Fires when the text is changed in the textbox.
![Page 11: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/11.jpg)
An Example<html> <head> <title>My Page</title> </head> <body> <form name="myform"> <input type="text" size="25" value="Enter your name here!"> </form> </body></html>
Output:
![Page 12: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/12.jpg)
QUESTIONS..?
![Page 13: HTML FORMS The TEXT Object Presented By: Ankit Gupta](https://reader036.vdocument.in/reader036/viewer/2022081808/5a4d1ad17f8b9ab059971545/html5/thumbnails/13.jpg)
THANK YOU…!