- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2021 05:48 AM
Hello I have requirement, wherein if a user types in the variable (select box) - "this is a test name" then it should display as "thisisatestname" in the RITM and task. I have written the below simple code but doesn't work.
OnSubmit Client script
function onSubmit() {
//Remove spaces from the field
var first = g_form.getValue('variable1');
g_form.setValue('variable1',first.trim());
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2021 06:12 AM
Hi
Instead of trim use replace method.
Thanks & BR,
Murthy
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2021 07:20 AM
Hi All,
.replace worked fine. Thank you so much.
I had not checked the Apply to catalog item and apply to task check boxes, that is the reason why it was not populating. 🙂 Thank you again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2021 07:40 AM
Glad you got this working. Community etiquette note: Since only one answer can be marked as 'correct', it is customary to mark the response containing the correct answer that was posted first. Sometimes people opt to award the one that supplied the actual code and/or a link to a documented solution over one that just suggests an idea, but in the end it is entirely up to you.