Search results for 'Trim'. 1 post(s) found.

  1. 2007/09/05 Remove the spaces before begin and after end of text
2007/09/05 20:22

Remove the spaces before begin and after end of text


Followings are the sample code Trimming by javascript.

<!--This is developed by Nepali guys
for Further information please email us at
ha.p@mailcity.com
shivascm@hotmail.com
-->

<html>
<head><title>Remove the spaces before begin and after end of text</title>
<script>
function ChkSpace(txtval)
{
var i,j;
j=0;
for(i=0;i<txtval.length;i++)
{
    j++
    if(txtval.substr(i,1)!=" ")
        break;
}
txtval=txtval.substr(j-1,txtval.length);
if(txtval==" ")
   txtval="";
return(txtval);
}

function Check()
{
var txtval=document.frm.txtarea.value;
txtval=ChkSpace(txtval);
document.frm.txtarea.value=txtval;
}
</script>
</head>

<body>
<form name=frm>
    <textarea name=txtarea cols=50 rows=10></textarea>
    <input type=button value="Check" onclick="Check()">
</form>
</body>
</html>

Another posts included in "HTML, Javascript"

Code To Clear Browser History (1)2007/09/05
Add This Page To Favorites (0)2007/09/05
Add A Scrolling Status Bar Text To Your Site (0)2007/09/07
How To Close A Pop-up Window ? (0)2007/09/04
Pop Up Window On Top (0)2007/09/04
How to display message on browser status bar ? (0)2007/09/04
New Window (0)2007/09/04
Color Table (0)2007/09/03
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/28 22:50 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 07:07 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:38 delete

    moneyideas