on 08-29-2005 2:31 PM
Hi
I want to put the validation so tht the number entered should only be numeric. I cannot define it as int because i am using it in other validations also and for them i am using it as string. Is there a way through coding in which we can put this validation?
Thanks & regards,
Anupreet
One way is to use Integer.parseInt(String) it would return exception if it is non numeric. Handle the Exception.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What kind of "other validations" are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupreet,
As far as I know , there doesn't exists any inbuilt function to check validate the input as per your requirement. (But why do you need an attribute that accepts both numebrs & strings and then check whether it is numeric ?)
A small suggestion is to write your own Java function for the said validation. Call this function to validate your input.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.