- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 02:52 AM
I want to Concatenate First name & Last name variable value in Full name in the catalog item
I tried the below onchange client script for lastname
{
var fname=g_form.getValue('first_name');
var lname=g_form.getValue('last_name');
var ans = fname.concat(lname);
g_form.setValue('full_name', ans);
}
but I need space inbetween first name & last name currently it is combining the both variable values and also can you suggest which client script I need to prefer?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 03:04 AM
Hello @Kri ,
Did you try the above solution?
If my response helped please mark it correct and close the thread.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 03:20 AM
Hello @Kri ,
You can modify your script as:
var fname = g_form.getValue('first_name');
var lname = g_form.getValue('last_name');
var ans = fname + ' ' + lname;
g_form.setValue('full_name', ans);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 03:24 AM
Hi There,
You can try below code as well.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var fname= g_form.getDisplayValue('first_name');
var lname= g_form.getDisplayValue('last_name');
g_form.setDisplayValue('full_name', fname+ ' ' + lname);
}
Mark helpful/correct if the answer helps
Regards,
Kartik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 03:04 AM
Hello @Kri ,
Did you try the above solution?
If my response helped please mark it correct and close the thread.
Thanks.