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

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 ..

Hello experts,
Am seeing the same problem while trying to validate an inputtext field that can only accept numbers. This input filed is part of a table ..Data expected here is an integer
since that is what is gotten from my ejb/sent for update to the db.
<af:inputText value="#{row.daysToReview}"
required="#{bindings.AdminResultBeanresultBeanArray.attrDefs.days.mandatory}"
columns="#{bindingsAdminResultBeanresultBeanArray.attrHints.days.displayWidth}"
binding="#{backing_Admin.inputText2}"
id="inputText2"
label="#{res['admin.daysheader']}"
autoSubmit="true">
<af:validateRegExp pattern="[0-9]+"
noMatchMessageDetail="Please enter a number"/>
<f:convertNumber groupingUsed="false"
pattern="#{bindings.AdminResultBeanresultBeanArray.formats.days}"/>
</af:inputText>
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 ..
Thanks in advance.

Similar Messages

  • Field validation regular expression to accept only numbers

    Hello.
    I would like to have a field validation regular expression to accept only numbers - no characters. The list of pre-packaged regular expressions that are included with ApEx does not contain this and I am not a very good regular expression writer. Can anyone help?
    Thanks!
    Boris

    Under the Regular Expression validation all you need to have is:
    ^[[:digit:]]$For the email address it just depends how detailed you want it:
    ^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$or...
    [\w-]+@([\w-]+\.)+[\w-]+Hope these help
    Edited by: MikesHotRod on Sep 3, 2008 12:40 PM

  • How do I validate a field using names in Excel spreadsheet only

    I am new to PDF forms and I need to create one with a text field that is validated against a list of 300 names, to ensure the names are spelt correctly by the person completing the form.  Short of creating a dropdown box and manually typing in the 300 names, is there an easy way to do this?
    I have exported the form from Indesign as an interactive PDF, then created all the fields and now the client has asked for this??  The names are held in an excel spreadsheet.
    Also, second questions, is there an easy way to automatically generate a second form, rather than saving each form individually.  Basically one person could be completing 30-40 forms which each will need printing out centrally and rather than saving as the name of each person they are completing it for, is there an easy way to do this?
    Many thanks for any help you can offer, but please explain simply as I am new to all this. 

    Thanks Gilad,
    Issue 1# - the list should only change a few times each year, so how I will google how to hard-code it in a script as you suggest, sounds just what I was looking for, rather than a drop down with 300 names.
    Issue 2# - the form is a certificate with various options on, which are now fields, and each tutor may have between 12 and 60 to complete and then forward back to the office to be printed centrally.  So, is there a way that you can automatically create another blank form once one is completed until all the certificates are completed for the number of pupils and then save them all in the one file to email back to the office, or will each one need to be submitted individually for printing.
    Many thanks for your help

  • How do we validate input fields on the selection screen

    How do we validate input fields on the selection screen

    hi balram,
    u can validate input fields using <b>AT SELECTION-SCREEN</b>  Event.
    PARAMETERS : p_werks TYPE marc-werks.
    AT SELECTION-SCREEN ON p_werks.
    SELECT SINGLE *
    FROM t001w
    WHERE werks = p_werks.
    IF sy-subrc <> 0.
    MESSAGE 'Invalid Plant' TYPE 'I'.
    ENDIF.
    Like this, we can validate user input for plant.
    check this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    Reware me if useful......
    Harimanjesh AN

  • How can I only receive my iMessages to my phone without it going to my iPad as well?

    Didn't know which forum this would go to, so I figured I would ask. How can I only receive my iMessages on my phone without it going always to my iPad, without turning iMessage on my iPad off?

    Go to Program Files - Windows Searchqu Toolbar. Then click on uninstall app. It must be good. This s--- doesn't appear in the ADD/REMOVE PROG.
    if you can't escape from him, go in partition C and search "Searchqu" and delete everything that shows you the "searchqu".

  • How can I only allow free apps to be downloaded?

    How can I only allow free apps to be downloaded to my IPhone 4S?

    Sorry, but there's no way I know of to restrict downloading to free apps only. You can turn off purchasing of apps completely, but if purchasing is allowed, it's open other than by age range. You can of course remove any purchase method, but I don't believe that blocks the purchase; you just end up owing money.
    Regards.

  • HT3771 I Have a Kyocera FS-C2026MFP printer/scanner. How can I only pint the document in Black. I cannot work out how to not print in colour to save the inks!!

    I Have a Kyocera FS-C2026MFP printer/scanner. How can I only pint the document in Black. I cannot work out how to not print in colour to save the inks!!

    Welcome to Apple Support Communities. We're users here and do not speak for "Apple Inc." or "Kyocera Inc."
    http://usa.kyoceradocumentsolutions.com/americas/jsp/upload/resource/25359/0/Mac Driver3SoftwareGuide1.1.pdf
    On the printer driver documentation, Page 5, in the Imaging setting, although the options are not specifically shown, there should be an option on that screen of the print driver to click and select "B/W" or 'black and white' or 'grayscale' or 'monochrome' as Print Mode rather than the "Full Color" option shown in the illustration below.
    You access these settings once you have selected 'Print' from an app.
    If necessary, you might need to click on the 'Down arrow' button next to the printer name (OS X 10.6), or 'Show Details' button at the bottom of the print dialog box (OS X 10.8) to see additional settings.

  • How can i sync numbers from my iPad to my new iMac?

    how can i sync numbers from my ipad to my new imac?

    If you mean spreadsheets from within the Numbers app on your iPad to your computer's iTunes then there are instructions here. If you mean that you want to copy the Numbers app from the iPad to your computer then you can copy it to your computer's iTunes via File > Transfer Purchases; but if you want to use Numbers on your Mac then you will need to buy the Mac OS X version.

  • "how can I manage numbers i can be reached in the imessage?"

    How can I manage numbers i can be reached in the imessage?

    Hi Fabio7733,
    If you want to make sure that your phone numbers and addresses have been linked in iMessage, you may find the following article helpful:
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Regards,
    - Brenden

  • I downloaded a widget from apple and was unable to open it because a window appeared telling me that the developer was unidentified. How do I change the security preferences that allow me to only install apps from the Mac App Store?

    I downloaded a widget from apple and was unable to open it because a window appeared telling me that the developer was unidentified. How do I change the security preferences that allow me to only install apps from the Mac App Store?

    go to system preferences - security and privacy - under allow applications downloaded from - click on anywhere.

  • I have Photoshop CS6, Windows 7, I have no entry at the accesscode. When i will write the code into the nummeric fields. I can write only numbers, but no letters. What can I do?

    I have Photoshop CS6, Windows 7, I have no entry at the accesscode. When i will write the code into the nummeric fields. I can write only numbers, but no letters. What can I do?

    If you are talking about the serial number, as far as I know serial numbers are entirely numeric so there is no need to enter letters.  Maybe you are using the incorrect code.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • We used to only need to enter a password to login, but we need to enter user name too now. how can we only enter password?

    we used to only need to enter a password to login, but we need to enter user name too now. how can we only enter password?

    Open the Accounts or Users & Groups pane of System Preferences and set the login options to show the list of users.
    (67582)

  • How can give only select privilge to user

    hi all
    how can give only select privilge to user
    "connect" have many sytem privilge such as
    alter session,
    create cluster,
    create database link,
    create sequence,
    create session,
    create synonyms
    create table,
    create view,
    "resource" have many sytem privilge such as
    create cluster,
    create indextype,
    create operator,
    create procedure,
    create sequence,
    create table,
    create trigger,
    create type
    i want give only select privige to user

    afzal wrote:
    hi all
    how can give only select privilge to user
    "connect" have many sytem privilge such as
    alter session,
    create cluster,
    create database link,
    create sequence,
    create session,
    create synonyms
    create table,
    create view,
    "resource" have many sytem privilge such as
    create cluster,
    create indextype,
    create operator,
    create procedure,
    create sequence,
    create table,
    create trigger,
    create type
    i want give only select privige to userFirst of all, SELECT privilege is OBJECT type of privilege. It is not a SYSTEM privilege.
    Some of the examples for granting this priv I have mentioned below:
    Examples
    Suppose you own emp table. Now you want to grant select privilege on this table to other user “SAMI”.
    grant select on emp to sami;Suppose you want to grant select privilege on emp to all other users of the database. Then
    grant select on emp to public;

  • How can I only have my iphoto on the cloud and not in my HD?

    I ran out of HD on my Macbook Air. I want to have my photos only on iCloud. How can I do it?

    I want to have my photos only on iCloud. How can I do it?
    You can upload to iCloud Photo Library using the Photos.app at web interface at Www.icloud.com  .
    But if you do that, you cannot use the Photos for Mac app with iCloud Photo Library.
    If you want to use the Photos for Mac app with iCloud, your Mac will store at least  lightweight smaller versions of your iCloud photos on the Mac,so you can browse the photos, if no internet is available.

  • How can I sum numbers in a pdf? And, sum a partial list of numbers?

    How can I sum a list (or partial list) of numbers in a pdf?

    Thanks for your answer.  I have Adobe Acrobat 7.0 Professional.  If you
    can help me further by listing the necessary steps that would be great.
    Thanks.
    Barry Baker

Maybe you are looking for