on 03-30-2017 7:32 AM
Hello Experts,
I have an input field called "OpenQuantity" in my application where user can enter only number ( float or decimal are also allowed). I have put a validation from UI side to check whether an end user is entering number or not by using javascript method isNaN(). My applicatiion would be used in different countries. In France, they will use comma instead of decimal where if the user entered 5,6 my application will throw an error that it is not number. So mean to say isNaN() is not working for french language.
Could anyone please help me or suggest what kind of validation I can write in my application so that it can work for all the countries.
Regards,
Abhimanyu
how about a regular expression - something like a digit followed by a comma or a period followed by a digit
//\d+(\,|\.){0,1}\d+/g
something like that - hope it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what about a regular expression for numbers and either a dot or a comma in between:
something like
/\d+(\.|\,){1}\d+/g
1 or more digits followed by a dot/comma followed by 1 or more digits
hope it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.