/    Sign up×
Community /Pin to ProfileBookmark

keep dimensions of textarea constant

i have a textarea, and a select box. The options in the select box are the style of font to be appear in the textarea, which is changed using javascript.

The textarea has 25 rows and 50 cols. The problem is that the textarea changes its size depending on the font chosen.

I don’t know if the rows and cols are measurements regarding the font inside the textarea, but i was wondering if anyone knew how to keep the dimensions of the textarea constant?

Thanks.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@PittimannJun 02.2004 — Hi!

You could remove the cols and rows from the tag and put style stuff inside (width & height).

Cheers - Pit
Copy linkTweet thisAlerts:
@moondanceauthorJun 02.2004 — so instead of:

<textarea rows = "25" cols = "50"></textarea>

have:

<textarea style = "width: 400px; height: 250px;"></textarea>

?
Copy linkTweet thisAlerts:
@PittimannJun 02.2004 — Hi!

Yes! Or using a style tag or external css, using a class, id or tag in the css to define the attributes of the textarea.

Cheers - Pit
×

Success!

Help @moondance spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...