- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 08:22 PM
how to combine 2 single line text variable into 1 single line text variable after requester input both 2 single line text variable
scenario as per below
1. requester input single line text variable A and single line text variable B
2. automatically show single line text variable C information which has both information variable A and variable B.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 08:57 PM
Hi @TMKAM ,
You need to write two onChange catalog client scripts, one on variable A and second on variable B
Client Script 1 : onChange of var A
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var strB = g_form.getValue('var_b');
var strConc = newValue + ' ' + strB;
g_form.setValue('var_c', strConc );
}
Client script 2: onChange of var B
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var strA = g_form.getValue('var_a');
var strConc = strA + ' ' + newValue;
g_form.setValue('var_c', strConc);
}
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 08:54 PM
You can write on change client script on Variable B. You can add two variables and populate the same on Variable C.
Below is the sample script
g_form.setValue('variable_c') = g_form.getValue('variable_A') + "" + g_form.getValue('variable_B');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 08:57 PM
Hi @TMKAM ,
You need to write two onChange catalog client scripts, one on variable A and second on variable B
Client Script 1 : onChange of var A
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var strB = g_form.getValue('var_b');
var strConc = newValue + ' ' + strB;
g_form.setValue('var_c', strConc );
}
Client script 2: onChange of var B
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var strA = g_form.getValue('var_a');
var strConc = strA + ' ' + newValue;
g_form.setValue('var_c', strConc);
}
If my answer has helped with your question, please mark it as correct and helpful
Thanks!