Textarea Object

By: aathishankaran Viewed: 153259 times  Printer Friendly Format    


All the other form objects that you work with are designed for capturing data of limited size (less than 256 characters). The textarea object provides a means for capturing information that does not lend itself to simple text fields, radio buttons, or selection lists. You can use the textarea object to enter free-form data that spans several lines. You are limited to displaying ASCII text, but such basic formatting as paragraphs are allowed. The textarea object is defined using the standard HTML syntax: 

<TEXTAREA NAME="objectName" ROWS="numRows" COLS="numCols"

[WRAP="off|virtual|physical"] [onBlur="methodName"]

[onChange="methodName"] [onFocus="methodName"]

[onSelect="methodName"]>

displayText

</TEXTAREA> 

Events, methods and application are same as Text Box 

The Button Objects (Submit, Reset, and Button) 

Because graphical operating environments became dominant over the past decade, the push button is perhaps the most ubiquitous of all user interface components. HTML has three types of buttons you can use in your forms: button, submit, and reset. As you can see, two are specialized forms of the more generic button object. Using conventional HTML syntax, a button is defined as 

< INPUT TYPE="button | submit | reset" [NAME=" objectName"]

[VALUE="labelText"] [onClick="methodName"]> 

The three button types have different purposes: 

  1. Submit-The submit button submits the form in which it is contained to the server based on the parameters of the form. No JavaScript code is needed to perform this action because its behavior is built into the object itself.
  1. Reset-The reset button clears the values in the fields of the current form, restoring any default values that might have been set. As with the submit button, no JavaScript code is used for this.
  1. Button-The button object is a generic object with no predefined behavior built into it. In Order for this object to do anything, you need to add an onClick event handler to the button.

If you are new to HTML, you might be asking about the reasons for the submit and reset buttons because you could use a button object to perform these same tasks. These originated before the days of JavaScript, where you could not use a generic button because you had no means of making it do anything. Additionally, although not all browsers support JavaScript (and thus the button object), all modern browsers do support the reset and submit buttons. For compatibility reasons, it is usually best to use the submit and reset buttons unless JavaScript support is a requirement for accessing your page, and in that case, it would not matter.



Most Viewed Articles (in JSP )

Latest Articles (in JSP)

Comment on this tutorial