Validation on comma separated values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 11:50 PM
Hi Team,
I have a requirement,
We have a catalog item,where we have one variable called as'TAX ID' which is single line text field.
so users should enter the TAX ID manually,and after that we have to validate whether the 'tax id ' entered is correct or not,We are getting the 'TAX ID' from integration and is stored in tax table.
So,whenever users enter the 'TAX ID' manually we have to validate if the entered value is present in the table or not.
Issue is some values in the Tax table are stored as comma separated values as shown below:
But the users can enter only one value,so how to validate that.
Thank,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 01:58 AM
Hi Sandeep,
Thanks for your response,but mine issue is :
I have this Tax ID Column in Tax table ,here the values are comma separated.
But user can enter only one Tax ID ,suppose if the user enters 789,then also it should validate and user should be able to submit the form.How this can be done.
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 12:50 AM
Hello @KARAN24 ,
You can try removing the comma from the number and try carrying out validation
x = parseInt(x.replace(/[,]/g,''));
Thanks,
Omkar