/    Sign up×
Community /Pin to ProfileBookmark

Script not working in IE9

This works perfectly in Chrome but not in IE9. Do not understand why.

[CODE]
<script>

var result = 0;

function add(button, knappen)
{
if (button==”Knapp1″) {
document.getElementById(button).innerText = ++result;
document.getElementById(knappen).disabled = true;
document.getElementById(button).innerHTML = result;
}

if (button==”Knapp2″) {
document.getElementById(button).innerText = ++result;
document.getElementById(knappen).disabled = true;
document.getElementById(button).innerHTML = result;
}

if (button==”Knapp3″) {
document.getElementById(button).innerText = ++result;
document.getElementById(knappen).disabled = true;
document.getElementById(button).innerHTML = result;
}

}

</script>

<table>
<tr>
<td><b>Destination:</b></td>
<td><b><?php echo $row[‘destination1’]; ?> </b></td>
<td width=”120″><button onclick=”add(‘Knapp1′,’Knappen1’);” id=”Knappen1″>Knapp 1</button><td>
<td><div id=”Knapp1″></div></td>
</tr>
<tr>
<td><b>Destination:</b></td>
<td><b><?php echo $row[‘destination2’]; ?></b></td>
<td width=”120″><button onclick=”add(‘Knapp2′,’Knappen2’);” id=”Knappen2″>Knapp 2</button></td>
<td><div id=”Knapp2″></div></td>
</tr>
<tr>
<td><b>Destination:</b></td>
<td><b><?php echo $row[‘destination3’]; ?></b></td>
<td><button onclick=”add(‘Knapp3′,’Knappen3’);” id=”Knappen3″>Knapp 3</button></td>
<td><div id=”Knapp3″></div></td>
</tr>
</table>

[/CODE]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@amit7soniNov 28.2013 — its working fine on ie9 on my system

check this fiddle
Copy linkTweet thisAlerts:
@Logic_AliNov 28.2013 — Are you sure you have IE configured to run scripts?

Does a simple alert work?
Copy linkTweet thisAlerts:
@md7daniauthorNov 28.2013 — Works in Chrome but in IE9 I get: Unable to set value of the property 'value': object is null or undefined


Code:0

Line 40 Char 2

Not sure if the Line of the problem is correct, can I trust it? If so here is the Line 39 + 40:

if (button=="Knapp1") {

document.getElementById(button).innerText = ++result;
Copy linkTweet thisAlerts:
@md7daniauthorNov 28.2013 — Just a question: How do I edit a post here at webdeveloper.com?

Just ignore my previous post. The script can show alert messages but will not disable the button, only in IE. No error in the script according to IE.
Copy linkTweet thisAlerts:
@Logic_AliNov 28.2013 — Just a question: How do I edit a post here at webdeveloper.com?[/QUOTE]On this site the Edit button times-out after a moronically short time.


Just ignore my previous post. The script can show alert messages but will not disable the button, only in IE. No error in the script according to IE.[/QUOTE]

For [I]disabled[/I] attribute support in IE9 you may need to use <!doctype html>
×

Success!

Help @md7dani spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...