JavaScript IE Incompatiblity |
Author: |
Message: |
lordy
Senior Member
Posts: 853 Reputation: 24
35 / /
Joined: Jul 2004
Status: Away
|
O.P. JavaScript IE Incompatiblity
Ok I have this javascript code:
code: function getElem(id) {
var divid = document.getElementById(id);
return divid;
}
function msnAddShow() {
var form = getElem('hostsu');
var tblrow = getElem('msnadd');
var msnAdd = null;
for (i=0; i<form.msn.length; i++) {
if (form.msn[i].checked) {
msnAdd = form.msn[i].value;
}
}
if (msnAdd == "yes") {
tblrow.style.display = "table-row";
}
else {
tblrow.style.display = "none";
}
}
Problem is that it doesn't work in IE. What it's meant to do is detect if someone has selected 'yes' to the radio button 'do you have MSN Messenger?' and, if they have, display a text box beneath it for them to enter their MSN address. Live code is at: http://www.teaspoondiner.net/hosting.php?act=signup
It works in all browser BUT IE... is there something I can change for it to work in IE as well as the other browsers?
|
|
07-03-2006 04:30 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: JavaScript IE Incompatiblity
Throw the text box for the MSN address into a DIV give it an ID when they click Yes, document.getElementById('id').style.display = ''; if they click no document.getElementById('id').style.display = 'none';
both would be onClicks
|
|
07-03-2006 04:34 AM |
|
|
kotjze
Full Member
Posts: 123 Reputation: 14
– / /
Joined: Apr 2005
|
RE: JavaScript IE Incompatiblity
Sorry to be off-topic, but at the top, "This website is best viewed using Mozilla Firefox, on a screen resolution of 1027x768 or higher." I'm sure you mean "1024x768"?
And yeah, I couldn't get it to work in IE/Maxthon either I don't see why it wouldn't work though.
|
|
07-03-2006 04:34 AM |
|
|
lordy
Senior Member
Posts: 853 Reputation: 24
35 / /
Joined: Jul 2004
Status: Away
|
O.P. RE: JavaScript IE Incompatiblity
quote: Originally posted by Kotjze
Sorry to be off-topic, but at the top, "This website is best viewed using Mozilla Firefox, on a screen resolution of 1027x768 or higher." I'm sure you mean "1024x768"?
Yeah that's what i meant quote: Originally posted by Matty
Throw the text box for the MSN address into a DIV give it an ID when they click Yes, document.getElementById('id').style.display = ''; if they click no document.getElementById('id').style.display = 'none';
both would be onClicks
But you can't have individual table rows in a div can you?
|
|
07-03-2006 04:44 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: JavaScript IE Incompatiblity
quote: Originally posted by lordy
quote: Originally posted by Matty
Throw the text box for the MSN address into a DIV give it an ID when they click Yes, document.getElementById('id').style.display = ''; if they click no document.getElementById('id').style.display = 'none';
both would be onClicks
But you can't have individual table rows in a div can you?
It will work take this for an example
or this code: <script>
function hideshow(id){
if (document.getElementById(id).style.display == ''){
document.getElementById(id).style.display = 'none';
}else{ document.getElementById(id).style.display = ''; }
}
</script>
<input id="hideme" />
<input onclick="hideshow('hideme')" type="button" value="hide show" />
Attachment: 1.html (440 bytes)
This file has been downloaded 134 time(s).
This post was edited on 07-03-2006 at 04:58 AM by matty.
|
|
07-03-2006 04:57 AM |
|
|
lordy
Senior Member
Posts: 853 Reputation: 24
35 / /
Joined: Jul 2004
Status: Away
|
O.P. RE: JavaScript IE Incompatiblity
But it would have to hide more than just the text box... did you look at the actual page it's on?
|
|
07-03-2006 04:59 AM |
|
|
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
Joined: Jan 2003
|
RE: JavaScript IE Incompatiblity
then wrap what you want to hide in a DIV with an ID?
Spoiler: the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
|
|
07-03-2006 05:06 AM |
|
|
lordy
Senior Member
Posts: 853 Reputation: 24
35 / /
Joined: Jul 2004
Status: Away
|
O.P. RE: JavaScript IE Incompatiblity
I can't because you can't wrap an individual table row in a div Is anyone actually looking at the page?
|
|
07-03-2006 05:16 AM |
|
|
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
Joined: Jan 2003
|
RE: JavaScript IE Incompatiblity
then give the table row an ID?
Spoiler: the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
|
|
07-03-2006 05:16 AM |
|
|
lordy
Senior Member
Posts: 853 Reputation: 24
35 / /
Joined: Jul 2004
Status: Away
|
O.P. RE: JavaScript IE Incompatiblity
That's what i have now and it's not working in IE... would someone actually look at the source code i have and then answer the question!?
This post was edited on 07-03-2006 at 05:20 AM by lordy.
|
|
07-03-2006 05:19 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|