November 14th, 2001, 01:11 AM
I have textarea to provide user add article, if user seem font too small in textarea, user can click button to increase font size to 16 px or increase to 10 px, and user can preview article by click preview
I'm modify my code to view simple like this
I have 2 problem with this code
font-family:MS Sans Serif;font-size:10px;
<form action="<? echo $PHP_SELF; ?>" method="post" name='b'>
<textarea name="a" cols=100 rows=20></textarea> <br><br>
<input type="button" value='increase font' onClick='document.b.a.style.fontSize = 16'>
<input type="button" value='decrease font' onClick='document.b.a.style.fontSize = 10'><br>
<input type=submit value=preview>
<input type=submit value=add>
1. If i'm click increase font to 16 px, the size of text is exceed border of table. How should I do?
2. If I'm increase size to 16px and click preview, when it load again, font it textarea remain 10px (instead 16 px) How shold I do?
November 14th, 2001, 04:39 AM
You can't modify the current DOM like that, when you post a textarea it will just post pure text anyway. Either you will have to use tags (like the ones used here, which is kinda crap), or you'll have to write your own little editor using editable elements and execCommand() (IE5.5). Some info on this can be found here:
Puritanism: The haunting fear that someone, somewhere may be having fun
November 14th, 2001, 04:46 AM
Oh, that'll be nice and accessible to people using any other browser won't it!? Not to mention people who may not rely on sight navigate pages.