How to allow user to put only numbers and backspace?

Hello!
On my form i need to prevent user from typing anything but numbers in a specific field. But i also need to let user delete typed symbols.
For that porpuse i have a function:
function regExp(newsymbol){
    var re = /[0-9\b]/;
    if(newsymbol.length > 1)
    return "";
    else if (re.test(newsymbol)){
        return newsymbol;
    }else{
        return "";
If i type backspace (trying to delete symbol) an "else" part of the expresion works.
So, how to fix my regexp, to let users delete symbols or are there any other ways to check if backspace is pressed (like keyCode and so on)?

I don't understand fully why you need to check if the backspace key is pressed since it sounds like you want them to be able to use it.
If you want to prevent them from entering numbers then put the following in the change event of the field:
if (!/\d/.test(xfa.event.change))
xfa.event.change="";
Kyle

Similar Messages

  • Is there any property in OPA for textbox - allow only numbers and hypen

    Hi,
    I am working in .net code with OPA rules engine. I have set of OPA screens with textboxes.I want to restrict the user to type only numbers and hypens for some of the text boxes(like phone no,ssn,zip code and so on).
    As you know,this can be done in .Net javascript/jquery.The problem is , we don't have any clue to identify which textboxes needs to be restricted(out of 25 textboxes in entire flow ,only 4 needs to be restricted). Currently,nly the idea we have based on the screen title and question(hard coding).But it's not the right solution.If the rulebase changed,it won't work.
    Is there any property/API in OPA end for textboxes to set to give some clue to front end developers(dotnet) not to allow other than numeric and hypen for these textboxes ? OPA developer has written some rules for this , but it will do the validation only after entering the value, we want to restrict the keyboard entry itself based on some property getting from OPA.
    Thanks.

    Thanks for your quick response, actually OPA developer added some regular expression to validate the textbox entry, as you said it's working properly after entering some values in textboxes.
    But, still i am looking to do the keyboard manual entry restriction in front end .NETcode based on some clue from OPA.I can understand keyboard entry restiction can't be done in OPA end. We use OPA rules engine to display the screens and textbox controls in front end .NET code.
    But if i get some clue from OPA ,like saying that,these are the textboxes having reg expression property for which you need to restrict only numbers and hypen.
    We have around 100 screens in the flow , out of which some of the screens have textboxes(out of that only few textboxes needs to be restricted only numbers and hypen) .
    Currently , i have some javascript code to restrict the keyboard entry ,but it's working common for all the textboxes, i want to restrict only few textboxes which should accept only numbers and hypens.If i get any property/clue from OPA, saying that this is the property for textbox for which you should restrict only numbers.
    Like , for example, multilinecount property for textboxes which should appear bigger. As of now,OPA developer doesn't have any clue about how to do this.
    Thanks,

  • How to allow user print their draft anwsers before sending it as final ?

    How to allow user print their draft anwsers before sending it as final in a form central questionnaire ?

    Hey MTdev,
    Panel close? events cannot be triggered on a VI being viewed or controlled remotely. Some more information on that can be found in the help here:http://zone.ni.com/reference/en-XX/help/371361E-01/lvprop/vi_panel_closeq/.  My suggestion would be to set the Title Bar on the front panel of your remote VI to not be visible so that their only option for closing the window is to click the logout button.  Are you using Remote Front Panels(http://zone.ni.com/devzone/cda/tut/p/id/3277) to do this instrument control?  Using remote front panels allows you to manage a lot of the multiple people accesssing at the same-time type issues so it may be something to look into if you are not already using this method.  
    Regards,
    Kevin
    Product Support Engineer
    National Instruments

  • Anybody knows that how to Allowing user Customization at runtime for portle

    Anybody knows that how to Allowing user Customization at runtime for portlet.
    What i want is to let user Customization persist to the repository. (not session). bu tmy testing accodring the Jdev 11g guide shows not working for portlet..
    Any body knows how to do this for portlet ? Web center 11g
    thanks a lot.
    Wayne

    Hi Wayne,
    You can only save runtime customizations to the repository for the users present in jazn-data.xml file (If you are using file based security).
    You will have to do the following before you can start saving user customizations:
    1. Create Webcenter Template project.
    2. Apply ADF Security
    3. Use page-definition files for jspx pages.
    After this, whatever customizations you do, will be saved to persistence storage.
    Better would be to try this on server. Since, before deploying, you run the pre-deployment tool, which will take the MDS Repository path as an input and store all persistence storage there.
    If there is nothing in that location, you can be sure something is wrong and debug it.
    Hope that was helpful.
    Regards,
    Kunal Chheda.

  • How to allow user chaning his password in OBIEE 11g weblogic custom LDAP?

    Hi,
    How to allow user chaning his password in OBIEE 11g weblogic custom LDAP?
    I need to give user an option to do so, without the intervention of any Administrator. I also do not want to make user a Administrator else he will be able to login in weblogic and can do any damages unknowingly.....
    Regards,
    Rahul

    Hi,
    Replace the line in the instantconfig.xml
    <WebMessage name=”kmsgChangePasswordLink”><!–<HTML><sawm:messageRef name=”kmsgUIChangePassword”/></HTML>–></WebMessage>
    with
    <WebMessage name=”kmsgChangePasswordLink”><HTML><sawm:messageRef name=”kmsgUIChangePassword”/></HTML></WebMessage>

  • Interactive form, how to allow user use comment and markup tool?

    hi, gurus,
    we are using
      CALL FUNCTION 'FP_JOB_OPEN'
    and
      CALL FUNCTION 'FP_JOB_close'
    together with the sfp funciton module to generate fillable pdf file, but we found out that the pdf generated does not allow user to use the comment and markup tool, it's required adddition reader right?
    could you please how to generate the pdf that can allow user to insert comments ?
    best regards.
    jun

    Hi,
    please follow these steps:
    - You have to enable ReaderRights (on ADS configuration using VisualAdmin)
    - The PDF must be static and NOT dynamic
    Then it works.
    Take care,
    Thomas

  • Allowing user to access only documents created by him.

    Hi!, is there a way to allow users to read only the documents created by them?, so when they click on the browse data buttons on top they navigate through the documents created only by the specific user?
    Thank you!

    Hi,
    Please check Data Ownership Authorisation if the same is of help in your case.
    [Data Ownership Authorisation|https://websmp201.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_HIER_KEY=701100035871000371280&_OBJECT=011000358700004490662004E&_SCENARIO=01100035870000000183&]
    Regards,
    Jitin
    SAP Business One Forum Team

  • How do i get my already purchased "numbers" and 'Pages" onto my new iPad??

    how can i get my already purchased 'numbers' and 'pages' onto my new ipad?

    If you have already purchased the iOS versions of these applications, they will appear in your "Purchases" list in the app store. Register your iPad with the same Apple ID as was used for the purchase, and you will be able to download and install it on the iPad (and on any other iOS device registered under the same Apple ID).
    Wayne's response applies if your previous purchase was the Mac OS X version of Numbers and Pages.
    Regards,
    Barry

  • How to force users to enter their ID and password ?

    I am considering installing AirPort Extreme at our office. We don't want guests connecting to our network. is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.

    How to force users to enter their ID and password?
    is there any option/software that will force the guest to enter an ID and password to connect to our network ? This is similar to what happens at the hotels when we try to connect to hotel's network.
    The AirPort Extreme does not have the features necessary to create a "splash page" that provides basic information about the company and asks users for their identity and password....like you see at most hotels.
    Basically, with an AirPort Extreme, users would have to scan to look for the name of the wireless network to join, and then enter the password to connect.
    The best that you might be able to achieve with the AirPort Extreme is create a "hidden" network, which would require that users know both the name of the wireless network and password to connect.  However, based on experience, this might be more of a hassle than anything else.
    The bottom line.....Apple really designed the AirPort routers for home use, so that might be the best place for them in most cases.

  • On and iPad how to Allow User To Enter Custom Text  (Dropdown only) Enables users to enter a value other than the ones in the list.

    On an iPad, how do I :
    Allow User To Enter Custom Text
    (Dropdown only) Enables users to enter a value other than the ones in the list.'?

    Are you using the built-in Currency option under the Format tab? If so,
    what you're describing should not happen.

  • How to make textfield to take only numbers, & it wont allow us to enter any other characters

    make textfield to take only numbers, & it wont allow us to enter any other characters

    Clean up the code a little (credit goes to Sakthivel
    var oInput = new sap.ui.commons.TextField();
    oInput.onAfterRendering = function() {
      if (sap.ui.commons.TextField.prototype.onAfterRendering) {
        sap.ui.commons.TextField.prototype.onAfterRendering.apply(this, arguments);
      this.$().keydown(function(event) {
        var ctrlKey = event.ctrlKey;
        var altKey = event.altKey;
        var shiftKey = event.shiftKey;
        var key = event.keyCode;
        return (
          ctrlKey ||
          altKey  ||
          ( 47 < key && key < 58 && shiftKey === false) ||
          ( 95 < key && key < 106 ) ||
          ( key === 8) || (key === 9) ||  
          ( key > 34 && key < 40) ||
          ( key === 46)
    oInput.placeAt('content');
    -D

  • How to allow user to select pdf file on local machine and populate field with file name only

    Folks,
    I have a project requirement that I am stumped on.  I am admittedly a novice, so forgive questions that may seem obvious.
    My requirement is a form running on a client system where the user can click a button and select a PDF file name from a PDF on their local machine and then populate a form field with that file path & filename.  The file names vary between all machines, so there is no static list.  Note that the PDF is not embedded, nothing is executed, I simply need the file name.
    There are several of these on a form (20+), so manual name entry is too error prone.   I would like to use a 'browse' type dialog, but can not figure out how to implement it.
    I've looked at app.browseForFile, but the users can not install a javascript file in their adobe folder or any other files;  the functionality has to be integral with the original PDF. 
    Functionally, this is no different from the image object file browse, except that I need a PDF instead of an image file, so there doesn't seem like there should be a security issue that is any different from those surrounding the image object.
    I've been stumped on this for the entire week, and I have a deadline rapidly approaching, so any examples or suggestions (please remember I'm a novice) would be greatly appreciated! 

    Thanks for the reply Paul - do you have any sample code of how to attach the PDF?  Or how the user can select a PDF to open?  I might be able to attach it, retrieve the file name, and then un-attach it.
    Alternatively, do you know how to retrieve the file name from the imagePath object?  It will let you select PDF files, but I can't find info on how to retrieve the file name.   It should be the way you would retrieve the file name for an image.
    As a novice in this, thanks for your help and patience!

  • How to allow user to select multiple languages in ESO

    Hi Expert,
    I need your help on ESO languages capability.
    I need to allow end user to change language options like from english to chinese or from chinese to spanish. Now we have this option only tied to profile like user can select only one language in profile in "display langauge" option.
    Please help me how to do this in ESO as i am new to this application.
    Thanks much for your cooperation and help in advance.
    Regards,
    Gurvi.

    use transaction SE63 in order to translate the texts -> menu Translation / ABAP Objects / Short texts then choose OTR in tree
    to find object name, use the matchcode and specify the development class (or package) as collection
    SAP will display texts according to logon language of user

  • How to allow user to enter multiple values?

    Hi, can someone tell me how I can allow user to select multiple values from a selection screen. To be more clear, I have to display 4 values on the selection screen and want to allow user to select 2 or 3 values from it. It will be very helpful if someone could tell me how to do it.
    Thanks in advance,
    pushpa

    hi mahesh,
    pls c the code below. this is what i have written in my program. when i run this program it is showing only one value and that too only the first one '1234'. i want that it display all the values that i gave in the initialization part.
    please help.
    thanks,
    pushpa
    SELECTION-SCREEN BEGIN OF BLOCK enter_data WITH FRAME TITLE text-001.
    SELECT-OPTIONS skunnr FOR kna1-kunnr.
    SELECTION-SCREEN END OF BLOCK enter_data.
    INITIALIZATION.
    skunnr-low = '1234'.
    skunnr-sign = 'I'.
    skunnr-option = 'EQ'.
    APPEND skunnr.
    skunnr-low = '9824'.
    skunnr-sign = 'I'.
    skunnr-option = 'EQ'.
    APPEND skunnr.
    skunnr-low = '8756'.
    skunnr-sign = 'I'.
    skunnr-option = 'EQ'.
    APPEND skunnr.
    skunnr-low = '6534'.
    skunnr-sign = 'I'.
    skunnr-option = 'EQ'.
    APPEND skunnr.

  • How to allow users to mount a Samba shares on a WXP

    Through lots of reading I've managed to get an understanding of how to mount SMB shares at bootup by placing the proper edits in /etc/fstab. While having the shares of the server, running Contribs.org SME Server 6.01 (recently known as Mitel SME Server) and acting as a samba server, being mounted at startup is perfect since the server is always on. This is not the best idea for the XP workstation since it isn't always on. Here is a copy of my present fstab file with x's replacing the passwords.
    fstab               [B---]  0 L:[  1+19  20/ 21] *(1085/1086b)= .  10 0x0A
    # /etc/fstab: static file system information
    # <file system>        <dir>         <type>    <options>          <dump> <pass>
    none                   /proc         proc      defaults            0      0
    none                   /dev/pts      devpts    defaults            0      0
    none                   /dev/shm      tmpfs     defaults            0      0
    tmpfs                  /tmp          tmpfs     defaults            0      0
    sysfs                  /sys          sysfs     defaults            0      0
    usbdevfs               /proc/bus/usb usbdevfs  defaults            0      0
    /dev/cdroms/cdrom0     /mnt/cd   iso9660   ro,user,noauto,unhide   0      0
    /dev/cdroms/cdrom0     /mnt/dvd  udf       ro,user,noauto,unhide   0      0
    /dev/floppy/0          /mnt/fl   vfat      user,noauto,unhide      0      0
    //192.168.2.2/stuff    /mnt/silicon2 smbfs username=kingnubian,password=xxxxxxx,user
    //192.168.2.105/e-smith   /mnt/silicon1 smbfs username=kingnubian,password=xxxxxxx,users,noauto
    /dev/discs/disc0/part5 swap swap defaults 0 0
    /dev/discs/disc0/part1 / xfs defaults 0 1
    I would like users with an account on the Linux box to mount the remote share on the XP box without needing to SU and consequently need the root password. When trying now to mount "e-smith" (The share on the XP box) as a user using "mount /mnt/silicon1" I get a message about needing to be SU.

    To allow users to mount smb shares you need to make smbmnt suid:
    # chmod +s /usr/bin/smbmnt
    Note however that the user needs to own the directory used as mountpoint. So I don't know how to make 'mount /mnt/silicon1' in your setup work for all users.
    For the users to be able to unmount the smb shares as well you need:
    # chmod +s /usr/bin/smbumount
    Now users can do 'smbmount //server/share mountpoint -o username=whatever' or simply 'mount mountpoint' if the details are specified in fstab. To unmount root can do 'umount mountpoint' or users can do 'smbumount mountpoint'.
    Don't confuse smbmount with smbmnt - the first is the command you use to mount shares manually, the second is the one that should be suid and is used both by smbmount and by mount -t smb.
    Hope this helps.
    -bogomipz

Maybe you are looking for