[Dojo-interest] How to add multiple lines to textarea

Chris Fleischmann chris.fleischmann at sun.com
Thu Aug 28 21:16:48 UTC 2008


I tried, 

dojo.byId('t_textA').attr('value', "this<br>is<br>a<br>test"); and 
dijit.byId('t_textA').attr('value', "this<br>is<br>a<br>test");

and the output i got through the firebug console is;

dojo.byId("t_textA").attr is not a function???

Thanks for your help thus far.

Chris



V S P wrote:
> 
> see if may be
> dijit.byId('textA').attr('value', "this<br>is<br>a<br>test");
> 
> would work
> 
> 
> 
> 
> On Thu, 28 Aug 2008 07:55:45 -0700 (PDT), "Chris Fleischmann"
> <chris.fleischmann at sun.com> said:
>> 
>> Folks, I have a textarea within a contentpane of a tabcontainer which is
>> part
>> of  form, the textarea has been set up like so:
>> 
>> <div>
>> <textarea dojoType="dijit.form.Textarea"    
>>                         d="textA" 
>>                                   name="textA"
>>                                   style="width:300px;"
>>                                   required="true"
>>                                   intermediateChanges="true"
>>                                   >Enter here!</textarea>
>> </div>
>> 
>> On the page I have a dojo.addOnLoad() method where I want to be able to
>> dynamically update the value (contents) of the text area. I tried the
>> following:
>> 
>> ojo.addOnLoad(function() {
>> 				dojo.byId('textA').value = "this\nis\na\ntest";
>> });
>> 
>> to no avail...? What is the correct method...??
>> 
>> I have tried dijit.byId, dojo.byid, I have also tried innerHTML (swapping
>> out \n with <br>) ie., dojo.byId('textA').innerHTML =
>> "This<br>is<br>a<br>test"
>> 
>> With the innerHTML command I can get the multiple lines to happen/be
>> represented but the textarea becomes uneditible, perhaps turning the
>> textarea in to a "SPAN" intead :-(
>> 
>> I'm using FF3, Safari 3, Dojo 1.1.1.
>> 
>> My dijit.form.TextArea sits on a contentpane (a div) its within a
>> TabContainer (dijit.layout.TabContainer) which inturn is part of
>> dijit.form.Form.
>> 
>> Thanks for any help you may be able to provide.
>> 
>> Regards,
>> 
>> Chris
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-to-add-multiple-lines-to-textarea-tp19202377p19202377.html
>> Sent from the Dojo mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> Dojo-interest at dojotoolkit.org
>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
> -- 
>   V S P
>   toreason at fastmail.fm
> 
> -- 
> http://www.fastmail.fm - Email service worth paying for. Try it for free
> 
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-add-multiple-lines-to-textarea-tp19202377p19209338.html
Sent from the Dojo mailing list archive at Nabble.com.



More information about the Dojo-interest mailing list