flemingmike Posted September 19, 2014 Share Posted September 19, 2014 <script> //Calculate Labour function filllabour(aa) { //Parse aa var the_string = aa; var parts = the_string.split('-', 2); // After calling split(), 'parts' is an array with two elements: // parts[0] is 'left or -' // parts[1] is 'right of -' var the_text = parts[0]; var the_num = parts[1]; //Parse aa var dblQuantity = document.getElementById('lqlabour-' + the_num).value-0; var curRate = document.getElementById("llabour-" + the_num).value-0; var curRateHelper = document.getElementById("lhelper-" + the_num).value-0; var dblMarkup = document.getElementById("lmarkup-" + the_num).value-0; var curTotal = parseFloat(dblMarkup) / 100.0; llinetotal = ((dblQuantity * curRate) + (dblQuantity * curRateHelper)) * (1 + curTotal); llinetotal = llinetotal.toFixed(2); document.getElementById("ltotal-" + the_num).value = llinetotal; //document.getElementById(the_num).value = ("test"); //alert(the_num); //collect all line totals var inputs = document.getElementsByName("ltotal[]"); var laboursubtotal = 0; for (var i = 0.00; i < inputs.length; i++){ if (inputs[i].type = "text"){ laboursubtotal += parseFloat(inputs[i].value, 10); } } //collect all line totals laboursubtotal = laboursubtotal.toFixed(2); document.getElementById("labourtotal").value = laboursubtotal; filltotal(); } //Calculate Labour </script> hi, in ie11 we are forced to use compatibility mode for one of our web applications written in php. above is a script that from what I understand is the error is with getElementsByName. any suggestions for me in ie11? Quote Link to comment https://forums.phpfreaks.com/topic/291157-php-in-ie-11-compatibility-mode/ Share on other sites More sharing options...
CroNiX Posted September 19, 2014 Share Posted September 19, 2014 getElementsByName() is not php, it's javascript. Personally I'd use jQuery or another javascript framework. They fix things that are broken, or missing, in various different browsers so they all work the same and you don't run into things like this. Quote Link to comment https://forums.phpfreaks.com/topic/291157-php-in-ie-11-compatibility-mode/#findComment-1491565 Share on other sites More sharing options...
ginerjm Posted September 19, 2014 Share Posted September 19, 2014 It still would have been nice if you posted the error message. Quote Link to comment https://forums.phpfreaks.com/topic/291157-php-in-ie-11-compatibility-mode/#findComment-1491569 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.