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

V S P toreason at fastmail.fm
Thu Aug 28 15:27:00 UTC 2008


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



More information about the Dojo-interest mailing list