#4648 closed defect (worksforme)
Textarea: Can't access the value property
Reported by: | guest | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Dijit - Form | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The only way I've found to get the value out of a textarea is by grabbing it from one of its children. To me, this sounds a little ridiculous and the textarea control should operate like the standard HTML control; where you can use the .value property. Attached is some code.
Attachments (1)
Change History (8)
Changed 14 years ago by
Attachment: | test_Textarea.html added |
---|
comment:1 Changed 14 years ago by
Component: | General → Dijit |
---|---|
Milestone: | → 1.0 |
Owner: | anonymous deleted |
Doug, what do you think? Originally I asked for all form widgets to reflect their value in the value attribute, but then Cougar told me that was too expensive for Editor, and that Editor should only compute it's value when asked (thus, the getValue() accessor). So for Textarea, either getValue() or value (or both) should work.
comment:2 Changed 14 years ago by
Owner: | set to Douglas Hays |
---|---|
Summary: | Can't access the value property in a textarea → Textarea: Can't access the value property |
comment:3 follow-up: 4 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
getValue() accessor method is the way to get the value consistently for all form widgets. It seems to work for me.
comment:4 Changed 14 years ago by
Replying to doughays:
getValue() accessor method is the way to get the value consistently for all form widgets. It seems to work for me.
Could you post what you did because I get "not a function" in firebug. Thanks.
comment:5 Changed 14 years ago by
<div id="simpleTextArea" name="simpleTextArea" dojoType="dijit.form.Textarea" >this is a very simple resizable text area</div> <button onclick="alert('textarea value = ' + dijit.byId('simpleTextArea').getValue())" >Click me to see the value</button>
comment:6 Changed 14 years ago by
Oh, I was using dojo.byId instead of dijit.byId. Thanks for your help, Doug.
comment:7 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
modified version of test_Textarea. Hit the button "Test" to get the value from "largeTextArea"