How to make single line text variable on catalog item to accept Numberic/Integer value only?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 08:30 AM
Hi There,
1. Create a variable with type 'Single Line Text' as per your needs
2. Go to Type Specification Tab and change the validaton Regex to 'Number' or as per your requirement.
3. you can also limit the number of digits, End User can enter by using variable attributes 'max_length=X'
OUTPUT:
1. I can only type 3 digits because I set variable attributes 'max_length=3'
2. I cannot enter any other text, if End User does, they will recieve this error saying 'Not a Number'
Note: Not sure if I can post this here or I answered precisely, if anybody wants to help me on this, I am open for feedbacks.
0 REPLIES 0