GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Jul-2003, 08:11
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

textarea width problem


hi,

i got problem regarding table width of textarea field,as when i enter some long text in this field and submitt he form the width of table becomes to long let say if i type in 'this is the best forum site for any tutorials' and when i click save then in next line this text prints like this Text
_________________ Save
|_________________|
i type in textarea // 'this is the best forum site for any tutorials
and then clicks on save then this text in next line looks like this
this is the best forum site
for any tutorial

i want this text prints exactly the width of textarea
'this is the best forum
site for any tutorials
HTML Code:
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 width=100% name="rsTable" id=rsTable cols=12> <th nowrap>Text</th> <td align="center"> <textarea name="text" class="mybar" id="tar" cols="15" rows="1" onfocus="tarea();" onblur="tarea();" title=""></textarea> </td> <input type="button" value="Save" name="Save" > <td align="center"><?= $line["text"] ?></td> <!-- printing value of textarea usinh PHP --> </table> <script> function tarea() { if(document.getElementById) { if(document.getElementById("tar").rows == 3) { document.getElementById("tar").rows = 1 a = document.getElementById("tar").value if(a) { document.getElementById("tar").title = a } else { document.getElementById("tar").title = '' } } else { document.getElementById("tar").rows = 3 document.getElementById("tar").title = '' } } } </script>
also visit server2.vitodesign.com so that anybody can see the long width of text i want to make it reduce exactly like text area.

thansk in advance
Attached Images
File Type: jpg folie1.jpg (25.6 KB, 336 views)
  #2  
Old 19-Jul-2003, 06:44
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Try this:

HTML Code:
<table style="width:150px" border="1" cellspacing="0" cellpadding="1" name="rsTable" id="rsTable"> <tr><th nowrap="true">Text</th></tr> <tr><td align="center"><textarea name="text" class="mybar" id="tar" cols="15" rows="1" onfocus="tarea();" onblur="tarea();" title=""></textarea> <input type="button" value="Save" name="Save" /></td></tr> <tr><td style="margin:auto;table-layout:fixed;width:150px"><?php echo $line['text']; ?></td></tr> <!-- printing value of textarea usinh PHP --> </table>

Please note that the width value in table should equal the width value in the <td style="margin:auto;table-layout:fixed;width:150px">.

IOW, if you change one, please change the other too...
  #3  
Old 23-Jul-2003, 03:06
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
sorry for late reply as i was busy with soem other work...today only i checked this posting

its apprecable

thanks
 

Recent GIDBlogFirst week of IA training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
cols width problem zuzupus Web Design Forum 4 23-Jul-2003 06:48
HELP!: find window width? Center a <div>? Kingherc Web Design Forum 2 06-Jul-2003 05:25

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:39.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.