Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > TextArea width

Reply
Thread Tools

TextArea width

 
 
Liming
Guest
Posts: n/a
 
      06-20-2006
Hi,

I'm using a third party libray and I can drag a diveand resize it. The
issue is, I have a textarea inside of it and I need to resize the width
of textarea and height of textarea along with it.

I know what the width and height of the div will be when it finishes
dragging (in "px"), so how do I convert the width and height in "px" to
the cols and rows of a textarea?

thanks!

Limign

 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      06-20-2006
"Liming" schreef
> Hi,
>
> I'm using a third party libray and I can drag a diveand resize it. The
> issue is, I have a textarea inside of it and I need to resize the width
> of textarea and height of textarea along with it.
>
> I know what the width and height of the div will be when it finishes
> dragging (in "px"), so how do I convert the width and height in "px" to
> the cols and rows of a textarea?


You don't. You specify the new sizes of the textarea in pixels, in the exact
same way as you do with the div element. It is perhaps possible to calculate
the number of pixls that a col or row takes up by measuring, adding a row
and measuring again, but setting RefToTextarea.style.width = '400px'
directly allows setting the dimensions in much finer detail.
hth
ivo


 
Reply With Quote
 
 
 
 
Liming
Guest
Posts: n/a
 
      06-20-2006
ah, thanks lvo. I dont' know why I didn't think about it. Just got
stuck in that idea and never thought about setting via style property.
THANKS. it works perfectly now.



Ivo wrote:
> "Liming" schreef
> > Hi,
> >
> > I'm using a third party libray and I can drag a diveand resize it. The
> > issue is, I have a textarea inside of it and I need to resize the width
> > of textarea and height of textarea along with it.
> >
> > I know what the width and height of the div will be when it finishes
> > dragging (in "px"), so how do I convert the width and height in "px" to
> > the cols and rows of a textarea?

>
> You don't. You specify the new sizes of the textarea in pixels, in the exact
> same way as you do with the div element. It is perhaps possible to calculate
> the number of pixls that a col or row takes up by measuring, adding a row
> and measuring again, but setting RefToTextarea.style.width = '400px'
> directly allows setting the dimensions in much finer detail.
> hth
> ivo


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add </textarea> within <textarea> tags? frank.moens@gmail.com Javascript 1 07-04-2007 04:00 PM
Textarea Inside of a textarea wperry1@gmail.com ASP General 6 02-05-2006 08:00 AM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
Textarea's Height and Width not Sent to Firefox honcho ASP .Net 3 07-15-2005 02:15 PM
Removing carriage returns from <textarea></textarea> input Augustus ASP General 1 09-10-2003 04:55 AM



Advertisments