-
Feb 3rd, 2021, 06:31 PM
#1
Thread Starter
New Member
[RESOLVED] Why won't both button script run?
-
Feb 3rd, 2021, 09:07 PM
#2
Thread Starter
New Member
Re: Why won't both button script run?
OK I think I figured it out because this script now works.
It looks like I have to check first if the element is in the page (not null). I found the error when I used the browser to trace the script. New with this direct to aspx scripting.
Code:
<script>
//THIS IS FOR BUTTON C
if (document.getElementById("m_eiamExpandCollapseActiveDiv")) {
var z = document.getElementById("m_eiamExpandCollapseActiveDiv");
if (z.visibility !== "hidden") {
document.getElementById("m_ei1amActiveSumLBL").innerHTML = document.getElementById("m_ei1amActiveSumLBL").innerHTML.replace(/\/\d*/, "");
document.getElementById("m_ei1amAbsentSumLBL").innerHTML = document.getElementById("m_ei1amAbsentSumLBL").innerHTML.replace(/\/\d*/, "");
document.getElementById("m_ei1amLateSumLBL").innerHTML = document.getElementById("m_ei1amLateSumLBL").innerHTML.replace(/\/\d*/, "");
document.getElementById("m_ei1amEarlySumLBL").innerHTML = document.getElementById("m_ei1amEarlySumLBL").innerHTML.replace(/\/\d*/, "");
}
}
// THIS IS FOR BUTTON E
if ((document.getElementById("m_eipmExpandCollapseActiveDiv")) && (document.getElementById("m_autamExpandCollapseActiveDiv"))) {
var x = document.getElementById("m_eipmExpandCollapseActiveDiv");
var y = document.getElementById("m_autamExpandCollapseActiveDiv");
if ((x.visibility !== "hidden") && (y.visibility !== "hidden")) {
document.getElementById("m_eipmExpandCollapseActiveDiv").style.display = "none";
}
}
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|