You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vijay Pawar <vs...@orgltd.com> on 2003/06/10 08:08:58 UTC

[OT] document.createElement("textarea") how to invoke events on this

Hi All,

I would be obliged if someone helps me in this.

I am dynamically creating rows in my jsp by using the dom-tree functions

To create a text field i use :-

document.createElement("<input name='type"+indexVal+"' type='text'
size='3' maxlength='3' ondblClick='alert(this.value)'>");

The above code works fine and on double clicking, the the alert is invoked.

Now to create a text area using dom i use the following code :-

var td5 =       document.createElement("textarea");
		td5.setAttribute("name","mytextarea");
		td5.setAttribute("cols","10");
		td5.setAttribute("rows","2");
		td5.setAttribute("wrap","PHYSICAL");

Now i wish to add a javascript event to this text area and so i tried the
following
		td5.setAttribute("ondblClick=alert('hello')");

But this does not work. Can anyone please tell me how to add javascript
events to a text area that is generated like this.

Thanking in advance,
Vijay



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org