Home     |      Learn AJAX     |      Forum     |      Register     |      Submit Resource     |      Submit Article      |      Contact Us

Home JavaScript
 

JavaScript TextArea

 

TextArea in JavaScript is one of the most important components of an Ajax or JavaScript based application. This part of the programming language will allow developers to create text area for users. This is developed along with the form object in JavaScript since its role is to receive the data entered by users. This component is very common in many online applications since the goal of these applications is to interact with user's data.


Wrapping in HTML


The number one feature of TextArea for JavaScript is that it's wrapped in HTML. This means the application is lightweight and can easily interact with other elements in the application. Developers simply have to indicate the TextArea through this format:


HTML<TextArea>


The rest will be part of the application and their interaction with form is based on how the TextArea is called through methods, properties and event handlers.


The HTML <TextArea> is called to the form in two formats. Developers can either use a familiar tag that can be easily recalled. The advantage of this technique using tags is basically on familiarity. On the other hand, the integer format (starting with 0) is another option. Through these options, developers will be able to arrange the text and properly place them in form.


Working with defaultValue Property


The most powerful object related to TextArea is the defaultValue. In gist, this object can be added to the TextArea at any moment so that the TextArea will go back to its original properties. This can be treated as the "reset" function. The original property of the TextArea is defined by the parent form. The objects and event handlers are added so that the text area can interact with other functions in the Ajax or JavaScript based application.


Combining Object and Event Handler


An often ignored feature of the textArea object for JavaScript and Ajax is the handleEvent method. The syntax is coded this way:


object.handleEvent(event)


Notice that the object is not just using some random functions that will be implemented in the textArea. With this function, developer can actually add powerful events coding. This will virtually transform the textArea into a highly interactive part of the application.


But there is a bit of irony in this object. Because the event handler will be implemented in an HTML based function and in text, the events allowed are almost the same as the object. This means developers will have the same events to work with.


Using 3rd Party Functions


But the limitation of event handler within the object is not a reflection of the event handler as a standalone function. The option is still unlimited when it comes to event handlers in the text area. Developers can even use 3rd party libraries in their online application and enjoy more functionality. Of course, common sense has to be used before implementing any of these 3rd party libraries to ensure safety.


As a very important object, developers should be careful when implementing the text area. It's a simple function but should have significant effects in the application.



Read Next: Interacting with Images



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links