- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2017 10:54 AM
I want to make a UI action show up when certain fields are filled in without having to hit save. Hence using a onChange Client script. I've tried the below but no luck. Any help would be appreciated.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Create JIRA') > -1){
item.show();
}
});
}
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2017 01:07 PM
I was wrong, the above works if you do it correctly. But now I'm having another problem. When I change the value of one of the fields back to -None- it isn't taking the button away. Any ideas?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var issType = g_form.getValue('u_issue_type');
var jPri = g_form.getValue('u_jira_priority');
var jProj = g_form.getValue('u_jira_project');
if (issType != '' && jPri != '' && jProj != ''){
var items = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Create JIRA') > -1){
item.show();
}
});
}
else {
var items2 = $$('BUTTON').each(function(item){
if(item.innerHTML.indexOf('Create JIRA') > -1){
item.hide();
}
});
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 08:22 AM
Hey, did you ever figure out how to get this to work correctly? Our team is trying to do something very similar, where we want a button to show up only after all the mandatory fields have been filled out. Would love to get your suggestions on how to accomplish this cleanly. Thanks!