Onlineatoz.net | ToolBox HTML Control HTMLTextArea

ToolBox HTML Control HTMLTextArea

HTML TextArea Web Server Control

In ASP.NET environment,This article describes you how to work with HTML TextArea Control.In HTML environment, TextArea is an object that represents a TextArea in an HTML form. The TextArea control in a HTML form contains all instance of an <textarea> tag.

The HTML TextArea control is similar to the HTML Textbox except that it allows end user to enter text in multi-line in the textarea control

There are several functions available to access the HTML TextArea.some of its funtions are as follows,

  • document.getElementById()
  • document.getElementByName()
Text Objects Properties
  • id -Sets or returns the id of a TextArea
  • form -Returns a reference to the form that contains the TextArea
  • accessKey -Sets or returns the keyboard key to access a TextArea
  • disabled -Sets or returns whether or not a TextArea should be disabled
  • tabIndex -Sets or returns the tab order for a TextArea
  • name -Sets or returns the name of a TextArea
  • type -Returns the type of form element a TextArea is
  • cols - Sets or returns the width of a TextArea
  • rows - Sets or returns the Height of a textarea
  • readOnly -Sets or returns whether or not a TextArea field should be read-only
  • value -Sets or returns the text that is displayed on the TextArea
  • title -Sets or returns an element's advisory title
  • lang -Sets or returns the language code for an element
  • dir -Sets or returns the direction of TextArea
  • className -Sets or returns the class attribute of an element
TextArea Objects Methods
  • blur() -Performs focus when leave from the control
  • click() -Simulates a mouse-click on a TextArea
  • focus() -Performs focus when enter into the control

The following code snippets explains you the HTML TextArea in the web form.

in .aspx.cs page,

 void SubmitBtn_Click(Object sender, EventArgs e)
  {
    Span1.InnerHtml = txt1.Value;
  }

        

in .aspx page,

<form id="Form2" runat=server>
      <h3>Example</h3>
      <textarea id="txt1" 
               runat="server"/>
      <br>
      <input id="btn1" type="submit"  
             value="Submit" 
             onserverclick="SubmitBtn_Click" 
             runat="server"/>
      <p>
      <span id="Span1" 
            runat="server" />
   </form>
 
Related Links


Posted by: Admin
Posted on: 9/11/2011 at 8:35 PM
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed