- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 04:55 AM
Hi Team,
I have created one field which contains (',') seperated values like 123,456,789 and want to display the values in below format through onload Client script in the same field.
123
456
789
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:07 AM - edited 11-29-2022 05:12 AM
Hi @lucky6
Can you try below:
function onLoad() {
//Type appropriate comment here, and begin script below
var getVal = g_form.getValue("u_string_full_utf8_1"); //replace with your field name
var sp = getVal.split(",");
for (var i = 0; i < sp.length; i++) {
if (i == 0)
g_form.setValue("u_string_full_utf8_1", sp[i] + "\n");
else
g_form.setValue("u_string_full_utf8_1", g_form.getValue("u_string_full_utf8_1") + sp[i] + "\n");
}
}
Hope it helps.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:07 AM - edited 11-29-2022 05:12 AM
Hi @lucky6
Can you try below:
function onLoad() {
//Type appropriate comment here, and begin script below
var getVal = g_form.getValue("u_string_full_utf8_1"); //replace with your field name
var sp = getVal.split(",");
for (var i = 0; i < sp.length; i++) {
if (i == 0)
g_form.setValue("u_string_full_utf8_1", sp[i] + "\n");
else
g_form.setValue("u_string_full_utf8_1", g_form.getValue("u_string_full_utf8_1") + sp[i] + "\n");
}
}
Hope it helps.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:21 AM
Thanks murthy for the reply..
its populating only first value "123" I am.not getting other values in field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:31 AM
It's working..Thank you