textarea width problem
Posted: Fri Jul 18, 2003 9:09 am
textarea 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
<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 http://server2.vitodesign.com/log.phtml so that anybody can see the long width of text i want to make it reduce exactly like text area.
thansk in advance
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
<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 http://server2.vitodesign.com/log.phtml so that anybody can see the long width of text i want to make it reduce exactly like text area.
thansk in advance