• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

Javascript onchange from drop down menu not working on IE

I have an order form that works fine in Safari, Firefox, Chrome, and Opera, but in Internet Explorer the price won't update from a drop down menu.  

This is a very stripped down version of the real page I'm working on but beware that it has some extraneous bits of code that might not make sense out of context. The problem is visible, however.
Online here: http://protogeo.info/test/order-test.php

order-test.php
0
rubysue1
Asked:
rubysue1
1 Solution
 
kadabaCommented:
have the options this way and try

<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>

Open in new window

0
 
manjunathubCommented:
I have modified the code in Upgrade()

inside there alerts just remove it it will work...
function UpdatePrice()  {
		alert("1");
                basic_price = 199.00
		alert("2  " + basic_price);		
		Basicqty_elem=getRefToElem('BasicQty');
		alert("3  " + Basicqty_elem.options[Basicqty_elem.selectedIndex].text);
                Basicprice_elem=getRefToElem('BasicPrice');
		alert("4   " + Basicprice_elem);		
		tax_row_elem=getRefToElem ('tax_row');
		alert("5  " + tax_row_elem);
		tax_elem=getRefToElem('tax_description');
		alert("6   " + tax_elem);
		tax_tot_elem=getRefToElem('tax_value');
		alert("7    " + tax_tot_elem);
		total_elem=getRefToElem('total_amt');
		alert("8   "  + total_elem);

		totalamount_elem = getRefToElem('totalamount');
		alert("9   "  + totalamount_elem);
		taxamount_elem = getRefToElem('taxamount');
		alert("10   " + taxamount_elem);
		amount_elem = getRefToElem('amount');
		alert("11    "+ amount_elem);
		// do the math
		alert("fgdf  " +  Basicqty_elem.value);
		Basicprice=parseFloat(Basicqty_elem.options[Basicqty_elem.selectedIndex].text)*basic_price;
		alert("12   " + Basicprice);
		price = Basicprice;
		alert("13    "+ price);
		tax=0.0;
		alert("14   " + tax);
		Basicprice_elem.innerHTML=toCurrency(Basicprice);
		alert("15   "  + Basicprice_elem.innerHTML);
		total=price+tax; 
		alert("16    "+ total);
		total_elem.innerHTML=toCurrency(total);
		alert("17    " + total_elem.innerHTML);	
		total=price+tax; 
		alert("18   "+ total);
		total_elem.innerHTML=toCurrency(total);
		alert("19   " + total_elem.innerHTML);
		document.PaymentInfo.totalamount.value=toCurrency(total);
		alert("20    " + document.PaymentInfo.totalamount.value);
		document.PaymentInfo.taxAmount.value=toCurrency(tax);
		alert("21   " + document.PaymentInfo.taxAmount.value);
		alert(document.PaymentInfo.taxAmount.value);
		return true;
	}

Open in new window

0
 
princeatapiCommented:
yep .. you must append the value to the nodes / options in order to retrieve it using script .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now