- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 04:07 PM
Please I need help to resolve the following issue. We have OnChange Client Script that sets the value of NETWORK and MANUFACTURER ID fields when certain values are selected for Category and Subcategory fields respectively. It is actually working, but each time we change the Category and the subcategory fields to something different, the value of NETWORK and MANUFACTURER ID fields won't change. Your helps will be appreciated.
Thanks.
Below is the OnChange Client Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearValue('manufacturer_id');
var cat=g_form.getValue('category');
if(newValue=="sharepoint" && cat=="hardware")
{
g_form.setValue('manufacturer_id','N/A');
g_form.setValue('network','standalone');
}
//Type appropriate comment here, and begin script below
}
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 07:03 PM
Hi,
Your onChange client script, the one you posted above, will only work on ONE of the two fields that are involved here. Most likely, based off the script, you have the onChange client script only working on the subcategory field.
This means, if you change the category field, this onChange client script won't fire. You'd have to create one for onChange of category and one for onChange of subcategory. The "newValue" used in those client scripts refers to the newValue of the variable/field the onChange client script is set to run on. Meaning, if client script A is onChange of the category, then "newValue" is going to contain the new...value...of the category field.
The manufacturer_id and network fields will only change if the if statement before it....is true for both conditions. So you'd want to review that and ensure BOTH are true for the values of the manufacturer_id and network fields to be changed. Then also double-check your values to ensure N/A and standalone are appropriate values (they may be, but I just wanted to mention that you should check that).
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 07:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 07:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 06:49 AM
Hello
I see you've marked a reply as Correct. I'm glad you found an answer.
I don't think it's very clear what you ended up doing, especially since you've asked the same question to multiple people after the fact.
If you still need assistance, please let me know.
If you don't, please at least let us know what you did to resolve your issue.
Thanks and take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 07:02 AM
Hi Allen, I posted that because someone mentioned that he didn't understand the requirement, maybe wasn't clear enough. So that's why I posted the other explanation for better understanding of the requirements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 07:09 AM
Hi
So your issue is now resolved?
If so, what did you do to resolve it.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
