I need to find a way of either inputting separator eg, 12,000 without getting NaN message and if this can't be done then showing a message instead. I have looked through various sites and StackOverflow and can't work out how to do this (newbeeee issue). Current code as follows:
<script language="JavaScript" type="text/javascript">
function calcsavings()
{
var B1=document.forms[0].B1.value;
var B2n = Number("1516");
var B2=+B2n + +B1;
var B4 = Number("0.138");
var t;
for (i=0; i<document.forms[0].ITR.options.length; i++)
{
if (document.forms[0].ITR.options[i].selected)
t = document.forms[0].ITR.options[i].value;
}
var result=(B1/t-(B2/(1+B4)))*t
result=Math.round(result);
document.getElementById("childcaresavings").innerHTML=result;
}
</script>
I have stripped out the non-working code I tried before posting.