- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:33 AM
Hello All,
Like I have 3 fields are there which are single line text fields, so when user enter a value in first name as haresh and lastname as haru then the third field should population haresh haru as the display name in portal catalogue form..
Regards,
Haresh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:37 AM
Hi,
You need 2 Onchange Client scripts running on first name and last name fields. On each script read the current field and combine it with second field and populate to third field
Something like below
var fName = g_form.getValue('<first name field>');
var lName = g_form.getValue('<last name field>');
g_form.setValue('<Full name field>', fname + lName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:37 AM
Hi,
You need 2 Onchange Client scripts running on first name and last name fields. On each script read the current field and combine it with second field and populate to third field
Something like below
var fName = g_form.getValue('<first name field>');
var lName = g_form.getValue('<last name field>');
g_form.setValue('<Full name field>', fname + lName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:40 AM
Hello @Anurag Tripathi
Like in each client script do I need to use the same script or how and if I write the same script in two clients scripts it will work ?? Can you please explain me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:44 AM
Similar code, you will need to modify it a bit using the right field names and also check for blanks and how do you want to do it. Add validations etc. Also the field that you are populating , this should be read only , user should not be able to modify it manually
The idea is that user can write first name and then last name, or write last name then first name , change any of them multiple times (fixing typo or somehting).
So each time clear the value of display name and each time read the value of first name and last name and populate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2024 03:30 AM
Hello @Anurag Tripathi
I have used the bellow script its working as expected but i want if the user has entered any upper or lower case letters the display name should fill like this way "Firstname LASTNAME (Guest)" example Haresh HARU (Guest)..
Can you please help me on this ..