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

Similar Messages

  • When we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    when we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    Click here and ask the iTunes Store staff for assistance.
    (108048)

  • At the top of my iPhone 4s,(on the home screen) only the battery life is showing but on any other screen, it is normal. How do I fix it?

    At the top of my iPhone 4s,(on the home screen) only the battery life is showing but on any other screen, it is normal. How do I fix it?

    have you tried resetting the phone by holding the sleep/wake button and the home button until the phone restarts?

  • My iCloud has been 'upgrading' for the last 12 hrs. That is, after I had pressed 'install after downloading the latest, improved version without entering my password. How do I get back to the window that will allow me to enter my password?

    My iPad has been 'upgrading' for the last 12hrs.That is, after I had downloaded the new version of iCloud, and pressed 'Install' without entering my password. It is probably searching for it. How do I go back to the window that will allow me to enter my password. I have tried switching off the device, but each time the 'upgrading' comes on. I have also switched it off and left it on the charger for at least 6 hrs.

    My iPad has been 'upgrading' for the last 12hrs.That is, after I had downloaded the new version of iCloud, and pressed 'Install' without entering my password. It is probably searching for it. How do I go back to the window that will allow me to enter my password. I have tried switching off the device, but each time the 'upgrading' comes on. I have also switched it off and left it on the charger for at least 6 hrs.

  • TS2755 I can't hear me text message come in if my home screen is locked.  I can only hear it if my phone is on any other screen

    HELP!!!!!
    I can't hear me text message come in if my home screen is locked.  I can only hear it if my phone is on any other screen..

    Hello Trisha0422
    Check to see if Do Not Disturbed is turned on as does not notify with an alert or sound when the screen is locked. Look for the Moon in the upper right hand corner by your battery icon. 
    Set iPhone to Do Not Disturb
    http://support.apple.com/kb/TI6
    Regards,
    -Norm G.

  • How to make a page break in numbers

    The only way I found to make a new page in Numbers was to make new rows down to where the page would break, but it's only letting me add a few new rows to the new page.  I'd like to know how to make a page break without just adding rows.

    Hi Yellowbox,
    Still I'm not convinced, it gives you indeed some advantages but this page break is a great fault.
    All the company is working on Apple, we try even to keep Microsoft away but what when you make a quote of several pages and have to make your lay out at the end, it is a pain in your xxx to make it well.
    We cannot make different tables for each page nor I want to make it in Pages with a Numbers table.
    Secondly, what do you do when you get a Excell offer that you want to bring to Numbers.
    It opens well but again, you need to make all the page lay out afterwards!
    Thanks for yoru reply.
    It won't change my mind about Apple and Microsoft but for timing earning I won't changes all Excel offers to Numbers anymore. Even if I do not want, it would take me less time to work it out in Excel.
    Our own offers will remain in Numbers ...
    It is a pity but time is so important nowadays!
    Nice week-end.

  • How to make an indicator takes more than one input

    Hello,
    I want to know how to make an indicator ( like gauge for example) response to more than one case strrcuture result. In other words, how the indicator can take more than one input and move based on different input values ( the arrow of the gauge moves to different angles basesed on the logic structure and not only to one degree).
    Thanks in advance,
     

    YES, you got it right Coastal !
    This is what i want to do,
    I dont know how to establish this output in the software, i am still learning LabVIEW.
    I put a merge block to join the outputs but it didnt work.
    check it in the attached VI file.
    I am sure it is an easy thing but I dont know how to implement it.
    Any help you provide is appreciated,
    Best wishes 

  • How to make a function take a specific group of constants

    I know i asked this before, maybe a year ago, but I totally forgot how to do it, and I haven't been programming much lately. But I was wondering if somebody can tell me how to make a certain function take specific constants. For example there are java functions, of which I can not remember that will only take certain values. So the function might look like:
    public getInfo(String INFONAME){}Where INFONAME has to be like one of two names or something, and they are constants that are defined somewhere else. If anybody knows what I mean by this, and knows how to create functions like that please let me know. Thank you.

    here's an overkill,
    import java.util.*;
    abstract class DoWhatever {
        public static Hashtable ht = null;
        public static Object DoWhat( String s, Object obj ) {
         if( null == ht ) {
             ht = new Hashtable();
             ht.put( ThisDoWhatever.NAME, new ThisDoWhatever() );
             ht.put( ThatDoWhatever.NAME, new ThatDoWhatever() );        
         return ( (DoWhatever) ht.get( s ) ).doWhatever( obj );
        public abstract Object doWhatever( Object obj );
    class ThisDoWhatever extends DoWhatever {
        public final static String NAME = "this";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    class ThatDoWhatever extends DoWhatever {
        public final static String NAME = "that";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    public class DoThisOrThat {
        public static void main( String[] args ) {
         DoWhatever.DoWhat( args[ 0 ], null );
    }

  • How to make a simple program in numbers that i can use on my iphone

    how can i make a touchable program in numbers that i can trasfer to my iphone and use out in the field of work? i am pretty good at excel sheets,but am still new with my macbook.

    Excel can't make an iPhone application, it can only make a spreadsheet. You would need an iPhone app capable of reading a spreadsheet produced by Excel.

  • HOW TO MAKE FIELDS AS READ ONLY IN TABLE MAINTAINANCE

    HI ABAPers,
    HOW TO MAKE SOME FIELDS AS DISPLAY MODE.
    FOR SUPPOSE, THERE ARE 5 FIELDS in SM30.
    AMONG THEM 1 FIELD SHUD BE USED FOR EDITING AND THE OTHER 4 FIELDS SHUD ONLY BE USED FOR DISPLAY PURPOSE
    WHEN EVER I ENTER A VALUE IN THAT 1 PARTICULAR FIELD THEN THE DATA OF THE REMAINING 4 FIELDS SHUD BE DISPLAYED IN THE SAME SCREEN ITSELF.
    HOW CAN IT BE POSSIBLE...
    PLZ HELP.
    THNX IN ADV,
    SP.

    Hello SP,
    You can create a maintenance view for the table & here you can define the maintenance attribute for individual fields.
    For the fields you want to be READ-ONLY pass 'R' to those fields. (It is the 4th column from the left, the one to the immediate left of the Key column).
    Don't change the TMG function group directly. If you regenerate the TMG the changes would be overwritten !
    You can use the Event '01' to fulfill your requirement:
    *&      Form  f_event_01
    *       text
    FORM f_event_01.
      DATA: v_indx TYPE sy-index,
            v_land1 TYPE land1,
            v_name1 TYPE name1.
      FIELD-SYMBOLS: <vendor> TYPE lifnr,
                     <val> TYPE ANY.
      BREAK-POINT.
      "TOTAL contains all data which are read, changed and created in TMG
      LOOP AT total.
        IF <action> = neuer_eintrag " New Entry.
        OR <action> = aendern "Changed entry
        OR <action> = original. "Same as DB
          READ TABLE extract WITH KEY <vim_xtotal_key>.
          IF sy-subrc = 0.
            v_indx = sy-tabix.
          ELSE.
            CLEAR v_indx.
          ENDIF.
          ASSIGN COMPONENT 'LIFNR' OF STRUCTURE total TO <vendor>.
          CHECK sy-subrc = 0.
    *     select data from the LFA1 based on LIFNR
          SELECT SINGLE name1 land1 FROM lfa1
            INTO (v_name1,v_land1)
            WHERE lifnr = <vendor>.
          CHECK sy-subrc = 0.
    *     Populate the hidden fields NAME1 & LAND1
          ASSIGN COMPONENT 'NAME1' OF STRUCTURE total TO <val>.
          CHECK sy-subrc = 0.
          <val> = v_name1.
          ASSIGN COMPONENT 'LAND1' OF STRUCTURE total TO <val>.
          CHECK sy-subrc = 0.
          <val> = v_land1.
          MODIFY total.
          CHECK v_indx GT 0.
          extract = total. "Pass the changes in TOTAL to EXTRACT
          MODIFY extract INDEX v_indx.
        ENDIF.
      ENDLOOP.
      sy-subrc = 0.
    ENDFORM.                                                    "f_event_01
    BR,
    Suhas
    Edited by: Suhas Saha on Aug 16, 2010 11:58 AM

  • How to make report that contains only summaries?

    How to make a report in Designer/2000 that shows only summary fields? For example something like:
    select count(*) from emp;
    null

    How to make a report in Designer/2000 that shows only summary fields? For example something like:
    select count(*) from emp;
    null

  • How to make a page read only

    Hi all,
    Can anyone please help me out on the following issue.
    How to make a total page read only, so that he/she can not make any changes. I want the total page read only.
    Do we have any functions to do that?
    I need to do through peoplecode only because i have to check a condition.
    Please help me.
    Thank you,
    Bye.

    Without customizing, this may be accomplished via Permission List Security.
    Go to PeopleTools - Security - Permission List
    Select the desired Permission List. Click on the Pages tab.
    Find the menu and click on "Edit Components" hyperlink.
    Find the Component on the List and click on the "Edit Pages" hyperlink.
    Click on the Display Only check box for each page in the component you wish Display Only.
    If that does not sufice, you may use PeopleCode to set the Field DisplayOnly property to true for those editable fields that you wish not to be.
    HTH
    Steven E. Davies

  • How to make stork table in Mac numbers

    hello,
    how how to make stork tables in numbers just as what we can creat in windows excel?
    thank you

    Another way to create this type of chart is to create the pieces in separate charts and then layer them. 
    You create two stacked bar charts.  There are two rows of values in each.  The color of the bottom value is set to "no fill" to create the floating bar effect. 
    The width of the stick bar is changed by setting the gap to the maximum allowable (999%).  The "stick" chart is placed behind the other.
    For this to work, they need to be the exact same size and with the same axis values.  Setting the axis to have fixed values makes this easier.  Also, it improves the appearance to limit all the axis labels and lines to be in just one of the charts.

  • How to Identify whether string contains only numbers

    Hi Experts,
    How to identify whether a string contains only numbers...
    Thanks & Regards,
    Neeraj.

    Hi Neeraj,
    ISNUMERIC(String_Field)
    The above function returns '0' for non-numerics and
    '1' for numeric
    Hope this helps.
    Regards,
    Bala

  • How to make a PDF viewable only through an URL or a link?

    Hi
    I'm a newbie to Adobe Lifecycle ES. My ultimate aim to use this suite is to make my pdf viewable only through an URL or a weblink. The system must not allow the user to view the PDF without the particular URL. Is it possible to acheive this through Adobe Lifecycle ES? Please do reply as i'm in an urgency to finish my task.
    Thakns in advance

    If you are trying to control access to the actual URL where the Rights Managed PDF you would need to set up a way to authenticate users to allow them access ot the URL.  This would be done on the web\app server, not using Rights Management ES.
    You would use Rights Management ES to apply a policy to the PDF itself.  A policy controls who can view (open) the document, and once the user authenticates to the RM server to open the document, RM controls the permissions that that user has for the document (i.e. can the PDF be printed, can content be copied etc...)  RM cannot be used to control who can download a PDF form a URL.  Policies can also control if the user must be online and connected to the RM server to open the PDF, or you can allow "Offline" access for a set period of time where the user does not need a connection to view the PDF, however the user still needs to be authenticated to view the document offline.
    Regards
    Steve

Maybe you are looking for