- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2015 09:46 PM
For example: I would like to test for the 'Apply Proposed Changes' Button on the Change form when the status changes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2015 08:30 AM
Here is an old function I use to hide buttons for approval resets.
You could use something like this (create it as an onLoad Client script) and your onLoad calls the function as well as setting it.
Then create an onChange Client script that calls the same routine when something triggers the change to a field / status.
function resetRequestApproval() {
var refs = document.getElementsByTagName("BUTTON");
if (g_form.getValue('approval') == 'not requested')
{
// hide both "Request Reset" and "Reset Approval buttons"
if (refs) {
for (i=0; i < refs.length; i++)
{
ref = refs[i];
buttonphrase = ref.innerHTML;
if (buttonphrase == '<span>Request Reset</span>')
ref.style.display = 'none';
if (buttonphrase == '<span>Reset Approval</span>')
ref.style.display = 'none';
}
}
}
else
{
// Hide Reset Approval and show Request Reset
if (refs) {
for (i=0; i < refs.length; i++)
{
ref = refs[i];
buttonphrase = ref.innerHTML;
if (buttonphrase == '<span>Request Reset</span>')
ref.style.display = '';
if (buttonphrase == '<span>Reset Approval</span>')
ref.style.display = 'none';
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2015 08:30 AM
Here is an old function I use to hide buttons for approval resets.
You could use something like this (create it as an onLoad Client script) and your onLoad calls the function as well as setting it.
Then create an onChange Client script that calls the same routine when something triggers the change to a field / status.
function resetRequestApproval() {
var refs = document.getElementsByTagName("BUTTON");
if (g_form.getValue('approval') == 'not requested')
{
// hide both "Request Reset" and "Reset Approval buttons"
if (refs) {
for (i=0; i < refs.length; i++)
{
ref = refs[i];
buttonphrase = ref.innerHTML;
if (buttonphrase == '<span>Request Reset</span>')
ref.style.display = 'none';
if (buttonphrase == '<span>Reset Approval</span>')
ref.style.display = 'none';
}
}
}
else
{
// Hide Reset Approval and show Request Reset
if (refs) {
for (i=0; i < refs.length; i++)
{
ref = refs[i];
buttonphrase = ref.innerHTML;
if (buttonphrase == '<span>Request Reset</span>')
ref.style.display = '';
if (buttonphrase == '<span>Reset Approval</span>')
ref.style.display = 'none';
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2015 10:58 PM
Thank you for your responses:
Julian, that is the basics of what I needed.
Thanks
Peter