How to prevent semi colon in searchable keywords
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 12:09 AM
Guys-
I have one field on form and I want to restrict it when anyone put ; on that field ( string field)
I want to show error message and want to clear only ; not entire data that he putted
Can anyone suggest how we can achieve this?
I want this when he is filling that form and field presents on the form
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2024 05:50 AM
Something like this will work, onChange of whatever this field is (short_description in this example).
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue.indexOf(';') != -1) {
alert ('Semi-colon(s) removed');
g_form.setValue('short_description', newValue.replace(/;/g, '')); //replace all ; with nothing in this field
}
}