Welcome to WebmasterWorld Guest from 18.210.28.227

Forum Moderators: open

Message Too Old, No Replies

textarea does not wordwrap in firefox

     
4:13 pm on Aug 20, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 20, 2008
posts: 3
votes: 0


hey here is the great code ..
<script language="javascript" type="text/javascript">
var ijk = 0;
function txt_ara()
{
//alert("1");
//alert(document.getElementById("email").value.length);
//var ijk = 0;
//var incr = 2;
if(document.getElementById("email").value.length <= 59)
{
if(document.getElementById("email").value.length == 59)
{
document.getElementById("email").value += "\n";
}
}
else
{
var lkm = "";
if(ijk == 0)
{
lkm = parseInt(document.getElementById("email").value.length % 120);
}
else
{
lkm = parseInt(document.getElementById("email").value.length % 60);
}
if(lkm == 0)
{
ijk = 1;
document.getElementById("email").value += "\n";
}
}
}
</script>
<textarea name="email" id="email" class="txtField1" cols="60" rows="26" style="overflow-x:hidden; overflow-y: scroll; scrollbar-base-color:white; scrollbar-arrow-color:red; border:none; scrollbar-DarkShadow-Color:white;" wrap="hard" onkeyup="txt_ara();" onkeydown="txt_ara();"></textarea>
4:15 pm on Aug 20, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 20, 2008
posts: 3
votes: 0


thats code is working simply copy & paste the code and replace the 59 with the amount of character you want to show.......
4:21 pm on Aug 20, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 20, 2008
posts: 3
votes: 0


little modification with only check the firefox browser then it run that code...

////////////////////////////////////////////////////////////////////
<script language="javascript" type="text/javascript">
var ijk = 0;
function txt_ara()
{
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
{
if(document.getElementById("email").value.length <= 59)
{
if(document.getElementById("email").value.length == 59)
{
document.getElementById("email").value += "\n";
}
}
else
{
var lkm = "";
if(ijk == 0)
{
lkm = parseInt(document.getElementById("email").value.length % 120);
}
else
{
lkm = parseInt(document.getElementById("email").value.length % 60);
}
if(lkm == 0)
{
ijk = 1;
document.getElementById("email").value += "\n";
}
}
}
return true;
}
</script>
<textarea name="email" id="email" class="txtField1" cols="60" rows="26" style="overflow-x:hidden; overflow-y: scroll; scrollbar-base-color:white; scrollbar-arrow-color:red; border:none; scrollbar-DarkShadow-Color:white;" wrap="hard" onkeyup="txt_ara();" onkeydown="txt_ara();"></textarea>