?
Solved

Javascript onchange from drop down menu not working on IE

Posted on 2009-12-17
3
Medium Priority
?
436 Views
Last Modified: 2013-12-08
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
Comment
Question by:rubysue1
3 Comments
 
LVL 22

Accepted Solution

by:
kadaba earned 1000 total points
ID: 26078114
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
 
LVL 5

Expert Comment

by:manjunathub
ID: 26078171
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
 
LVL 11

Expert Comment

by:princeatapi
ID: 26078739
yep .. you must append the value to the nodes / options in order to retrieve it using script .
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question