//The script is designed to allow multiple elements to all be parsed. Simply insert the below code into the element's tag:
//onBlur="parseelement(this)"
//or
//onSubmit="parseelement(this)"
//Remove the $ sign if you wish the parse number to NOT include it
var prefix=""
var wd
function parseelement(thisone){
if (thisone.value.charAt(0)=="$")
return
wd="w"
var tempnum=thisone.value
for (i=0;i<tempnum.length;i++){
if (tempnum.charAt(i)=="."){
wd="d"
break
}
}
if (wd=="w")
thisone.value=prefix+tempnum+".00"
else{
if (tempnum.charAt(tempnum.length-2)=="."){
thisone.value=prefix+tempnum+"0"
}
else{
tempnum=Math.round(tempnum*100)/100
thisone.value=prefix+tempnum
}
}
}
