<script>
function Set_Comma(n){
return Number(String(n).replace(/\..*|[^\d]/g,"")).toLocaleString().slice(0,-3);
}
</script>
<BODY>
<FORM name="frm">
<input type="text" maxlength="20" name="amount" style=" text-align:right;" onkeyup="this.value = Set_Comma(this.value);">
</FORM>