Can anyone please tell me what I'm doing wrong here.
My page receives a variable from a previous page but when I try to use it in a simple adding function I get an answer but not quite what I expected such as If the value contains a comma eg 2,500.00 then my calculation only sees the 2 and adds the value 2 to my other variable. If I hard code the variable it still returns the same so I know it's not the request.form but my function but I have been unable to find a solution on the web.
My page receives a variable from a previous page but when I try to use it in a simple adding function I get an answer but not quite what I expected such as If the value contains a comma eg 2,500.00 then my calculation only sees the 2 and adds the value 2 to my other variable. If I hard code the variable it still returns the same so I know it's not the request.form but my function but I have been unable to find a solution on the web.
Code:
<SCRIPT LANGAUAGE="javaScript">
function calcTotal() {
var f = document.forms['form1'];
var BrokerComm = parseFloat(f.elements['txtBroker'].value);
var CortsTotalWithOptions = parseFloat(f.elements['CortsPriceWithOptionsHidden'].value);
f.elements['txtCortsTotal'].value = parseFloat(BrokerComm) + parseFloat(CortsTotalWithOptions);
}
</script>