- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019 05:55 PM
Hello,
I am trying to populate Description and Short Description based upon a list of form choices.
If a user selects "Server Reboot" the following basic information needs to populate.
I have the following script, which populates a these fields when a use changes values. The problem I'm running into is that the value changes when the page refreshes or the change progresses to the next state. Does anyone have any advice?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
newValue = g_form.getValue('u_quick_change_type');
if (newValue == 'menlo whitelist') {
g_form.setValue('short_description', 'Menlo Whitelist Add');
g_form.setValue('description', 'URL: \nReason For Change:');
}
else if (newValue == 'server reboot') {
g_form.setValue('short_description', 'Server Reboot [Enter Server Name]');
g_form.setValue('description', 'Servername: \nReboot Reason:');
}
else if (newValue == 'firewall port open') {
g_form.setValue('short_description', 'Firewall Port Open');
g_form.setValue('description', 'Source Port: \nDestination Port:\nApplication Type:');
}
else if (newValue == 'firewall port close') {
g_form.setValue('short_description', 'Firewall Port Close');
g_form.setValue('description', 'Source Port: \nDestination Port: \nApplication Type:');
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019 06:05 PM
Add the following line as the first line of your client script for not allowing it to run on load:
if(isLoading) {
return;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019 06:03 PM
Check Onchange field and type is set correctly on client script. Can you share full screenshot of client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019 06:05 PM
Add the following line as the first line of your client script for not allowing it to run on load:
if(isLoading) {
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 09:28 AM
This did the trick! Thank you so much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:03 PM
Glad that it worked 🙂
Cheers,
Manish