Jump to content

php in ie 11 compatibility mode


flemingmike

Recommended Posts


<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?

 

Link to comment
https://forums.phpfreaks.com/topic/291157-php-in-ie-11-compatibility-mode/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.