473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

TextArea width

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

Jun 20 '06 #1
2 2638
Ivo
"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
Jun 20 '06 #2
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


Jun 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
3
by: phil_gg04 | last post by:
Dear CSS Experts, I want to make a textarea fill all the available width. This is something I've done before but mostly by trial and error; now I want to understand what is going on. So I try:...
4
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
6
by: Tony | last post by:
The w3schools HTML tag reference for <textarea> http://www.w3schools.com/tags/tag_textarea.asp says that the attributes 'cols' and 'rows' are REQUIRED attributes for the textarea tag. Looking at...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed...
6
by: gilbert.george | last post by:
Hi, I am setting the width of a textarea using the style.width to ensure the textarea is exactly the right width. I want to set the height/rows of the textarea depending on it's contents (so...
1
by: nagamalli26 | last post by:
hai iam new php. i am creating admin side. i wrote this, phpcode: <?php //include_once("config.php"); $con=mysql_connect("localhost","root",""); mysql_select_db("happysalary"); ?>
2
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.