- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 02:21 AM
Hi all,
Does anyone know if there is a way of setting a character limit on user input fields in Virtual Agent topics? We have done similar things on variables in catalog items by using the max_length attribute however I can't see a way of doing this in VA. Despite educating our users we are finding that they write war and peace when we ask them to explain their issue "in a few words" so we wanted to limit the amount of text they could input for certain questions. It would also be useful for Mobile number fields so that we could limit it to 11 digits.
Any help would be greatly appreciated.
Kind Regards
Richard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 09:59 AM
You can try using Custom Input format and use some code like this one to validate number of characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 02:13 AM
Hi StefanoZ,
Whilst I understand the code you have provided I have never been successful in using the Custom Input Controls before, is this something you have utilized? I'd love to know how I can make my own input that validates the numbers/characters. Would you mind sharing?
Thanks
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 02:43 AM
Hi Stefanoz,
Thanks so much for making me aware of this; I've never noticed it before! It is much more efficient than the method I demonstrated in my response to Mary.
Your code worked perfectly however I ended up using this instead:
function validate(value) {
var isValid = value.length <= 11
return {
valid: isValid,
error: isValid ? undefined : "Sorry, mobile numbers should be no more than 11 digits'"
};
}
Rich