- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:00 AM
Hi All,
On our record producer we have a variable called 'u_prod'. This is a lookup select box which is a list of product models.
I have the following onChange catalog client script. If the answer to u_prod is "Mobile App" it should set the value of the variable 'more_detials_answer' to "mobile_app' . If the answer is not "Mobile App" it should clear the value in more_details_answer.
The script is correctly setting the value when I select the option of Mobile App. If I then change the answer in u_prod thought it is not clearing the value.
Any suggestions where I am going wrong?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:22 AM
Hi,
Kindly use:
g_form.setValue('more_details_answer','');
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:06 AM
See if the below works:
for your else statement:
g_form.setValue instead of g_form.clearValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2018 02:02 AM
Hi,
I've amended the script, but this is still not working:
//Scrpt to set variable to the value of the answer in classic_data
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || oldValue) {
return;
}
var prod = g_form.getValue('u_prod');
alert(prod);
if(prod == ("Mobile App")){
g_form.setValue('more_details_answer', 'mobile_app');
}
else {
g_form.setValue('more_detials_answer',"");
}
}
When I select 'Mobile App' in the u_prod (Please choose the affected CDL product from the following list) variable it is populating 'mobile_app' in the more_details (Hidden - More Detials Answer) variable as I want. If I then change the answer for u_prod to anything else it is not clearing more_details_answer as I require. I've exposed the more_details_answer field which is normally hidden:
Any further suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2018 03:33 AM
I've pasted in the line from sunny11 response directly and this seems to have worked.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 10:22 AM
Hi,
Kindly use:
g_form.setValue('more_details_answer','');
Regards,
Munender