- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 05:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 04:11 PM
Change the function name from toggle to something else. Looks like this function name has something to do with the behavior of the code. It is giving me errors on the console. Change it to toggleCustom() and you are good to go. Your modified code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div>
<html><head></head>
<script>
function toggleCustom(button) {
if (button.value == "Active") {
button.value = "Last 6 months";
document.getElementById("active_incidents").style.display="block";
document.getElementById("last_six_months").style.display="none";
} else {
button.value = "Active";
document.getElementById("active_incidents").style.display="none";
document.getElementById("last_six_months").style.display="block";
}
}
</script>
<body>
<form action="">
<input type="button" id="1" value="Active" style="color:blue"
onclick="toggleCustom(this);">
</input>
<div id="active_incidents" style="display:block">
<iframe src="incident_list.do?sysparm_query=active=true" width="800" height="800">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<div id="last_six_months" style="display:none">
<iframe src="incident_list.do?sysparm_query=active=true^assignment_group=31a476a34f1022009cd07e918110c70e^opened_by=javascript:gs.getUserID()" width="600" height="800">
</iframe>
</div>
</form></body></html>
</div>
</j:jelly>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 04:11 PM
Change the function name from toggle to something else. Looks like this function name has something to do with the behavior of the code. It is giving me errors on the console. Change it to toggleCustom() and you are good to go. Your modified code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div>
<html><head></head>
<script>
function toggleCustom(button) {
if (button.value == "Active") {
button.value = "Last 6 months";
document.getElementById("active_incidents").style.display="block";
document.getElementById("last_six_months").style.display="none";
} else {
button.value = "Active";
document.getElementById("active_incidents").style.display="none";
document.getElementById("last_six_months").style.display="block";
}
}
</script>
<body>
<form action="">
<input type="button" id="1" value="Active" style="color:blue"
onclick="toggleCustom(this);">
</input>
<div id="active_incidents" style="display:block">
<iframe src="incident_list.do?sysparm_query=active=true" width="800" height="800">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<div id="last_six_months" style="display:none">
<iframe src="incident_list.do?sysparm_query=active=true^assignment_group=31a476a34f1022009cd07e918110c70e^opened_by=javascript:gs.getUserID()" width="600" height="800">
</iframe>
</div>
</form></body></html>
</div>
</j:jelly>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 08:38 AM
Share the code of the UI macro here