Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can i validate a Field so that it can accept only Numbers

Ravi KiranNov 11 2006 — edited Jan 22 2007
can any one help me to validate a filed so that it accepts only numbers if not alert user (client side JavaScript alert message)
Iam using JSF and ADF BC as the Technologies in my application ..
my requirement is to validate a filed so that i can accept only numbers in my jspx page..
I had used ADF regularExpression Validator do so... but it results in exception


java.lang.IllegalArgumentException: 'value' is not of type java.lang.String.
at oracle.adf.view.faces.validator.ValidatorUtils.assertIsString(ValidatorUtils.java:36)
at oracle.adf.view.faces.validator.RegExpValidator.validate(RegExpValidator.java:103)
at oracle.adf.view.faces.component.UIXEditableValue.validateValue(UIXEditableValue.java:378)

<af:validateRegExp pattern="[0-9]*"
noMatchMessageDetail="Please enter Numbers only"/>

Using validateRegExp i can only validate a field that accept String type data ..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 19 2007
Added on Nov 11 2006
4 comments
2,425 views