Javascript: Change text size in text area

Post your scripts here.

<b>Note:</b>The scripts must be your own, and please read the "Important: Read before you post" thread inside this category before participating here.
Locked
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Javascript: Change text size in text area

Post by Lixas »

using this simple Jscript, u can change text size in textarea ir in input line. This example will be with textarea:

Code: Select all

<html>
<head>
    <style type="text/css">
        body, td, tg, input, select {
            font-family: Verdana;
            font-size: 10px;
        }

</style>
</head>
<body onload="initPosition(****.forms[0].txtLayoutViewer)">
<form>
Change Font Size: 
<select onchange="this.form.txtLayoutViewer.style.fontSize = this.options[this.selectedIndex].value; initPosition(this.form.txtLayoutViewer);">
<option value="10">10px</option>
<option value="12">12px</option>
<option value="14">14px</option>
<option value="16">16px</option>
<option value="18">18px</option>
<option value="20">20px</option>
<option value="24">24px</option>
<option value="36">36px</option>
</select>


<textarea name="txtLayoutViewer" rows="15" cols="75" wrap="off">Any text u want to see how it changes.</textarea>
</form></body></html>


Image
SHAdmin
Posts: 2095
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post by SHAdmin »

Sorry for interrupting your topic Lixas, but this was necessary.

All posts that were as replies to this thread have been deleted. Please read http://www.smokyhosts.com/forums/viewtopic.php?t=920 before making any posts here. As per the rules, all the support and comments for the scripts posted in this category are supposed to be held at http://www.smokyhosts.com/forums/viewforum.php?f=22 . This perticular thread will be reserved only to Lixas and this perticular scripts updates/upgrades.

Anyways good script Lixas, you can continue to reply to this thread and carry out the further improvements/updates/upgrades for this script in this thread.
mohumben
Posts: 82
Joined: Thu Sep 15, 2005 9:45 pm

Post by mohumben »

Dear admin, please move this thread to some other forum.

But there are simple ways to change the textarea or other input's style (using CSS), for example:

Code: Select all

<textarea style="background-color: lightblue; font-family: arial"></textarea>
Self explanatory.
Locked