how to change the aligment of a textarea

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Feb 2007
Posts: 13
Reputation: dks1383 is an unknown quantity at this point 
Solved Threads: 0
dks1383 dks1383 is offline Offline
Newbie Poster

how to change the aligment of a textarea

 
0
  #1
Dec 31st, 2007
Hi all

How can I write a javascript code to change the alignment of a textarea so that the user can select a part of of a textarea and change the alignment of this part by clicking a button?
thanks
Last edited by dks1383; Dec 31st, 2007 at 4:09 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: how to change the aligment of a textarea

 
0
  #2
Jan 1st, 2008
Try the textAlign style.

But it may not work. The text alignment of a text box or a text area depends on the data type it is used for.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 5
Reputation: temp304 is an unknown quantity at this point 
Solved Threads: 1
temp304's Avatar
temp304 temp304 is offline Offline
Newbie Poster

Re: how to change the aligment of a textarea

 
0
  #3
Jan 3rd, 2008
text-align Attribute | textAlign Property

Sets or retrieves whether the text in the object is left-aligned, right-aligned, centered, or justified


The property is read/write for all objects except the following, for which it is read-only: currentStyle . The property has a default value of left . The Cascading Style Sheets (CSS) attribute is inherited.

Applies To: BLOCKQUOTE , BODY , CENTER , currentStyle , DD , DIR , DIV , DL , DT , FIELDSET , FORM , hn , HR , INPUT type=password , INPUT type=text , LI , LISTING , MARQUEE , MENU , OL , P , PLAINTEXT , PRE , runtimeStyle , style , TABLE , TD , TEXTAREA , TH , TR , UL , XMP
www.JavaScriptBank.com - 2.000+ free JavaScripts
Start hosting from: $22/year | With promo code: 97USDD | At DreamHost
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 439
Reputation: Fungus1487 is on a distinguished road 
Solved Threads: 50
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Pro in Training

Re: how to change the aligment of a textarea

 
0
  #4
Jan 3rd, 2008
but you still wont be able to align PART of the text differently to another part. Not in the same textbox anyway.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum


Views: 1169 | Replies: 3
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC