Done something similar using Javascript.
Code:
<script language="javascript">
String.prototype.fullTrim = function(){
theString = this.replace(/\t+/g,"\t");
theString = theString.replace(/^\t*([\S\s]*\S+)\s*$/,"$1");
document.frm.txt2.value=(theString==" ")?"":theString;
}
</script>
<form name="frm">
<textarea name="txt1" onBlur="this.value.fullTrim()" rows=5 cols=100>This text has a <tab>( )here, 2( )here, and 4( )here</textarea>
<br>
<textarea name="txt2" rows=5 cols=100></textarea>
</form>
Try to initiate onblur event on TEXTAREA 1 to see the effect.
Let me find you out that in ASP.
Cheers!
_________________________
-Vijay G

Strive for Perfection
