ojoonline
10-10-2005, 12:07 AM
hi,
I found this script here on the forum and was hoping someone could help me modify it??
It's perfect except for my use, except i would like it to count the spaces too.
<script language="JavaScript" type="text/javascript">
<!--
function Calculate(obj,m,opid){
nu=obj.value.replace(/\s/g,'').length;
document.getElementById(opid).value='£'+(nu*m).toFixed(2);
}
//-->
</script></head>
<body>
<input id="ip" size="10" onkeyup="Calculate(this,1.6,'op');" onblur="Calculate(this,1.6,'op');"><br>
<input id="op" size="10"><br>
thanks!!
jo
I found this script here on the forum and was hoping someone could help me modify it??
It's perfect except for my use, except i would like it to count the spaces too.
<script language="JavaScript" type="text/javascript">
<!--
function Calculate(obj,m,opid){
nu=obj.value.replace(/\s/g,'').length;
document.getElementById(opid).value='£'+(nu*m).toFixed(2);
}
//-->
</script></head>
<body>
<input id="ip" size="10" onkeyup="Calculate(this,1.6,'op');" onblur="Calculate(this,1.6,'op');"><br>
<input id="op" size="10"><br>
thanks!!
jo