- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 09:29 PM
Hi guys
I have a simple onchange client script on description field on incident table
My requirement is if user input is "//H$\\DB_Backup" then it should be accepted else not accepted
Below is script but everytime getting not accepted even for exactly same value
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == "//H$\\DB_Backup")
alert("accepted");
else
alert("not accepted");
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 05:43 AM
The backslash (\) is an escape character, so in the script you need to escape each one, if that makes any sense.
if (newValue == "//H$\\\\DB_Backup")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 05:43 AM
The backslash (\) is an escape character, so in the script you need to escape each one, if that makes any sense.
if (newValue == "//H$\\\\DB_Backup")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 11:24 PM
Hi @sunil maddheshi,
Can you try updating the below scripts.
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Samiksha Gunjate