What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » JavaScript IE Incompatiblity

Pages: (2): « First [ 1 ] 2 » Last »
JavaScript IE Incompatiblity
Author: Message:
lordy
Senior Member
****


Posts: 853
Reputation: 24
35 / Male / Flag
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? :undecided:
07-03-2006 04:30 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
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
Profile E-Mail PM Find Quote Report
kotjze
Full Member
***

Avatar

Posts: 123
Reputation: 14
– / Male / Flag
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
Profile PM Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
35 / Male / Flag
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 :P
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
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
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"  />

.html File 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
Profile E-Mail PM Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
35 / Male / Flag
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
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
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
Profile PM Web Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
35 / Male / Flag
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 8-) Is anyone actually looking at the page? :undecided:
07-03-2006 05:16 AM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
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
Profile PM Web Find Quote Report
lordy
Senior Member
****


Posts: 853
Reputation: 24
35 / Male / Flag
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
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On