textarea width problem

liunx

Guest
hi,<br />
<br />
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<br />
_________________ Save<br />
|_________________|<br />
i type in textarea // 'this is the best forum site for any tutorials<br />
and then clicks on save then this text in next line looks like this<br />
this is the best forum site <br />
for any tutorial<br />
<br />
i want this text prints exactly the width of textarea<br />
'this is the best forum<br />
site for any tutorials <br />
<br />
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 width=100% name="rsTable" id=rsTable cols=12><br />
<th nowrap>Text</th> <br />
<td align="center"><br />
<textarea name="text" class="mybar" id="tar" cols="15" rows="1" onfocus="tarea();" onblur="tarea();" title=""></textarea><br />
</td><br />
<input type="button" value="Save" name="Save" > <br />
<td align="center"><?= $line["text"] ?></td> //printing value of textarea usinh PHP<br />
</table><br />
<script> <br />
function tarea()<br />
{<br />
if(document.getElementById)<br />
{<br />
if(document.getElementById("tar").rows == 3)<br />
{<br />
document.getElementById("tar").rows = 1<br />
a = document.getElementById("tar").value<br />
if(a)<br />
{<br />
document.getElementById("tar").title = a<br />
}<br />
else<br />
{<br />
document.getElementById("tar").title = ''<br />
}<br />
}<br />
else<br />
{<br />
document.getElementById("tar").rows = 3<br />
document.getElementById("tar").title = ''<br />
}<br />
}<br />
}<br />
</script><br />
also visit <!-- m --><a class="postlink" href="http://server2.vitodesign.com/log.phtml">http://server2.vitodesign.com/log.phtml</a><!-- m --> so that anybody can see the long width of text i want to make it reduce exactly like text area.<br />
<br />
thansk in advance<!--content-->
 
Back
Top