Updating text with inner html returning cannot read undefined
I have this java code
- function updateprice(pprice, ppricediv, pform, popt) {
- var totAdd = pprice;
- var thisopt = popt;
- if (!isW3) return;
- var pDiv = document.getElementById(ppricediv);
- totAdd = totAdd + pricechecker(document.forms.pform.thisopt.options[document.forms.pform.thisopt.selectedIndex].value);
- pDiv.innerHTML = formatprice(Math.round(totAdd * 100.0) / 100.0, '', '');
- }
and it returns;
Cannot read property 'thisopt' of undefined
this is what I'm doing this;
onchange
="
updateprice('382.49' , 'pricediv1' , 'tform1' , ' optn0 ');
"
And I have no idea why?
Kind regards,
Glenn - glenn223