Jump to content

Archived

This topic is now archived and is closed to further replies.

vietboy505

determine textarea rows

Recommended Posts

I want my textarea box to not to have scrollbars. So depends on how long the message is, it will determine the rows. How would I do that, count the character in $message?

[code]
<textarea value="<?php echo $message; ?>" rows="<?php ?>" cols="20">
[/code]

Share this post


Link to post
Share on other sites
dont think this is the best way but you could do:

[code]
$msg=explode("\n",$message");
$lines=count($msg);

and the user rows="<?php echo $lines; ?>"
[/code]

as far as i can think that should work but only work by line not for long lines which will then be wrapped..

Share this post


Link to post
Share on other sites
Whats the point of using a textarea if you don't want to conserve space and use scrollbars? Doesn't make much sense..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.