Hello Everyone,
I have some Javascript that will not run in IE. It works OK in Firefox however. The code is supposed to toggle between hiding and displaying a few form elements when you click on a link. At first I thought it was because of the way IE treats the "getElementById" function (which I used in my code) but I commented out all the code and used the "alert" function to simply display a pop-up message and as before it worked in Firefox but not in IE. So far I have done the following to no avail:
1) Ensured that active scripting was enabled in the security settings of IE
2) Disabled pop-up blocking
3) Tried accessing the site from a machine with no antivirus/security software
4) Tried IE7 and IE6
I am out of ideas so any help would be appreciated. Here is an excerpt of the code
Thanks in advance
Liam
I have some Javascript that will not run in IE. It works OK in Firefox however. The code is supposed to toggle between hiding and displaying a few form elements when you click on a link. At first I thought it was because of the way IE treats the "getElementById" function (which I used in my code) but I commented out all the code and used the "alert" function to simply display a pop-up message and as before it worked in Firefox but not in IE. So far I have done the following to no avail:
1) Ensured that active scripting was enabled in the security settings of IE
2) Disabled pop-up blocking
3) Tried accessing the site from a machine with no antivirus/security software
4) Tried IE7 and IE6
I am out of ideas so any help would be appreciated. Here is an excerpt of the code
Code:
<?php defined('_JEXEC') or die('Restricted access'); ?>
<script type="text/javascript">
function changeVisibility()
{
if (document.getElementById("MySearchPhrase").style.display=="table-row")
{
document.getElementById("MySearchPhrase").style.display="none";
}
else
{
document.getElementById("MySearchPhrase").style.display="table-row";
}
if (document.getElementById("MyOrdering").style.display=="table-row")
{
document.getElementById("MyOrdering").style.display="none";
}
else
{
document.getElementById("MyOrdering").style.display="table-row";
}
if (document.getElementById("MySearchOnly").style.display=="table-row")
{
document.getElementById("MySearchOnly").style.display="none";
}
else
{
document.getElementById("MySearchOnly").style.display="table-row";
}
}
</script>
<!--//there is HTML code here but it is not relevant to the problem-->
<label for="Advanced" style="cursor:pointer">Advanced</label>
<input type="hidden" id="Advanced" onclick="changeVisibility()" />
Thanks in advance
Liam