- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 11:29 PM
Hi,
We need to set the default value of the "Multi-line text" type variable bassed on another variable of Type " select box". Can you help me in writing that code.
Regards,
B
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 11:56 PM
Hello Bijendar,
We could set the "Multi-line text" type variable value based on another variable of Type " select box" using onchange catalog client script.
Select the 'Variable name' to specific Select box variable.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var val = g_form.getValue('select_box'); // select_box : variable name of the select box
if(val == 'one'){
g_form.setValue('multi_line_text','ONE'); // multi_line_text: variable name of the multiline text
}
else if(val == 'two'){
g_form.setValue('multi_line_text','TWO');
}
}
Regrads,
Kiruthika Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 11:50 PM
Hello Bijender,
You can write onChange client script to achieve this?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('selectBoxVariableName', 'Multi-line text variable name');
}
}
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 11:56 PM
Hello Bijendar,
We could set the "Multi-line text" type variable value based on another variable of Type " select box" using onchange catalog client script.
Select the 'Variable name' to specific Select box variable.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var val = g_form.getValue('select_box'); // select_box : variable name of the select box
if(val == 'one'){
g_form.setValue('multi_line_text','ONE'); // multi_line_text: variable name of the multiline text
}
else if(val == 'two'){
g_form.setValue('multi_line_text','TWO');
}
}
Regrads,
Kiruthika Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2019 12:24 AM
Hi,
I tried this but default value is not updating,
My select box variable name is "Team" which have choice as database, network
and mutiline text variable is "ATSDept"
when i run the below code in catalogclient script as below it still not working, please can you check and help me in correcting it.