Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#5391 closed defect (invalid)

Textarea 1.0.1: Event handling does not work

Reported by: guest Owned by:
Priority: high Milestone:
Component: Dijit - Form Version: 1.0
Keywords: Textarea events Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

I cannot get Javascript Events to work with dijit.form.Textarea. Dojo Versions are 0.9, 1.0 and 1.0.1.

Below is a Testcase that creates both a textarea and a textbox. Textbox works fine, but Textarea event are only fired if the surrounding box is clicked. It should be fired when the text is clicked as well.

<title>Dojo Events are Great</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">

function foo(){
function fee(){
<script type="text/javascript">


        dojo.addOnLoad(function() {
			areaNode = dojo.byId("areaid");
			dojo.connect(areaNode, 'onclick', foo);
			boxNode = dojo.byId("boxid");
			dojo.connect(boxNode, 'onclick', fee);

<input dojoType='dijit.form.Textarea' name='area' id='areaid' value='a comment' ></input>
<input dojoType='dijit.form.TextBox' name='box' id='boxid' value='a box' ></input>


Change History (5)

comment:1 Changed 14 years ago by Dustin Machi

This code doesn't look to be correct.

  1. I don't see the domnode "container" that the parser is being used against (why not just use parseOnLoad: true in djConfig).

2.dojo.byId("areaid") will retrieve a domNode instance, but it looks like that is intended to be a widget not a domNode. dijit.byId("areaid"); would be used instead and retruns a Widget not a domNode.

  1. I'm not sure that the textarea or textbox widgets have normal onclick event once create. If so I would expect them to be named onClick instead of onclick.

comment:2 Changed 14 years ago by Adam Peller

Component: GeneralDijit
Description: modified (diff)
Owner: anonymous deleted

comment:3 Changed 14 years ago by bill

Resolution: invalid
Status: newclosed

What dmachi said is correct. You would need to change the code as he suggested, because widgets and dom nodes are not the same thing, but still onClick is not supported on anything besides buttons. Eventually we'll support at least onfocus and onblur on input widgets like TextArea? (see #5327), but not sure if we'll ever support more esoteric callbacks like onclick or onkeyup.

comment:4 Changed 14 years ago by guest

onFocus would be just fine, but that does not work either.

From my point of view, something that works with default HTML textarea code should also work with dijit Textarea.

And furthermore, the page does not at all mention that the dojo event system is limited to Buttons, but actually gives a standard HTML Link as an example.

comment:5 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.