Digital Point Forums
Winn and Sims

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old May 16th 2005, 2:18 pm
GoldDog GoldDog is offline
Peon
 
Join Date: Apr 2005
Posts: 5
GoldDog is on a distinguished road
IE no like innerHTML? FF does...

Can anyone tell me why IE doesn't like this script?

My function looks like this...

php Code:
var c = 0;
function reCalc(i) {
    c = 10*i;
    document.getElementById('subT').innerHTML = c;
}
...and the call to the function looks like this...

php Code:
<select name="qty" onchange="reCalc(this.value)">
...and the page element 'subT' looks like this...

php Code:
$<span id="subT">275</span>
In Mozilla subT gets rewritten to reflect the math requested in the function, but IE insists on setting the value of subT to 0 every time.

Any ideas? Thanks
Reply With Quote
  #2  
Old May 16th 2005, 2:26 pm
frankm's Avatar
frankm frankm is offline
Twilight Vanquisher
 
Join Date: Apr 2005
Location: Europe
Posts: 916
frankm has a spectacular aura aboutfrankm has a spectacular aura about
GD, your problem is not the innerHTML, but the onchange.

onchange="f(this.value);" does not work in IE.
you should use something like:
si = document.forms.form1.qty.selectedIndex;
if (si > 0)
{
v = document.forms.form1.qty.options[si].value;
}

but that's from the top of my head
Reply With Quote
  #3  
Old May 16th 2005, 3:20 pm
GoldDog GoldDog is offline
Peon
 
Join Date: Apr 2005
Posts: 5
GoldDog is on a distinguished road
That was it. Thanks frankm
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -8. The time now is 10:43 pm.