Text input mask

Hi All,
I want to add a mask to a text input field, so the user can only type numbers on it (integers, more specifically), I think that this is done by a Converter but it doesn't add the apropriate javascript.
How Can I do this? And if I want to mask to only floats?

are you talking about immediate input masking? as user types a phone number say xxx xxx xxxx, it'll automatically adds "-" in between? that, you would have to use javascript.
otherwise, create a custom converter and attach to your input box
<f:converter id="yourcompany.path.PhoneConverter"/>
convert user's phone number to yoru format.. othewise, generate a conversion error message

Similar Messages

  • Save a phone number without the input mask

    Hi,
    I actually have 2 related issues that I hope you might be able to help me with.
    I have a form linked to an interactive report, so when I click a record, the form is populated with the record's data. I just started using the new text field masked input plugin to handle phone number formatting, etc., which Patrick recommended.
    The plugin works nicely when a phone number being displayed from the source is 10 characters. The input mask I'm using is (999) 999-9999. However, I also have phone numbers in records that don't include the area code. When I select one of those records, the phone number field is blank. I would like it to display 999-9999, and be right justified. Is there an easy fix for that?
    My next problem occurs when I try to save the record. The process tries to save the phone number, including the mask, (14 characters), to the table. I only want to save the number to the table, excluding the mask. I'm sure there is a way to do this but I haven't found it yet.
    Thanks in advance for any help,
    Gary

    This is my solution to parsing the number only from the masked phone number:
    1) Create a field, 'P1_PHONE_MASKED', with a phone number mask: (?***) 999-9999
    2) Create a hidden Database Column like: 'P1_PHONE' It will initially hold the value of the record's phone column.
    3) create a javascript function in the page's before header section, between the space tags, to strip out all non-numeric values and update the hidden field:
    function remmask(src,tar){
    var mystring = $x(src).value;
    mystring = mystring.replace(/\D/g,'');
    $x(tar).value = mystring;
    4) Place the function call in the from in the HTML Form Elements Attributes of P1_PHONE_MASKED: onBlur="javascript:remmask('P1_PHONE_MASKED','P1_PHONE');"
    Now, anytime you change the value in P1_PHONE_MASKED, P1_PHONE gets updated with just the number values from P1_PHONE_MASKED.
    You can also add validation to the function to ensure that the length of the phone number is either 7, no area code, or 10, including area code. Normally, the mask should handle validation, but as you can see, to make this work, I had to make the mask more flexible, to allow for alpha numeric values in the first 3 positions and to allow for either 7 or 10 characters. Unfortunately, that means a user could enter something like XXX12 and the mask won't reject it.
    Partial solution to displaying ( ) 999-9999 in the masked input field P1_PHONE_MASKED when initially selecting a record for display.
    1) Make the Source Type for P1_PHONE_MASKED "SQL Query"
    2) Insert a query similar to the one below into "Source Value or Expression"
    SELECT
    CASE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 10
    THEN
    METAREPO.CONTACTS.CONTACT_PHONE
    WHEN length(METAREPO.CONTACTS.CONTACT_PHONE) = 7
    THEN
    '___'||METAREPO.CONTACTS_2011.CONTACT_PHONE
    END
    FROM METAREPO.CONTACTS
    WHERE METAREPO.CONTACTS.CONTACT_ID = :P1_CONTACT_ID
    This will display 7 digit phone nubers as follows: (___) 999-9999 in the masked field: P1_PHONE_MASKED.
    I wanted to use spaces between the () to make it perfect, but I'm unable to get this to work. I've tried things like:
    ' '||METAREPO.CONTACTS_2011.CONTACT_PHONE
    LPAD(METAREPO.CONTACTS_2011.CONTACT_PHONE,3,' ')
    Both of which work in PL/SQL Developer, but not in Apex. I believe this is because HTML collapses spaces by default.
    I would like very much to resolve this last issue. Any suggestions?
    Regards,
    Gary

  • Preformatted Dropdowns and Input Masks?

    I would like to know if there is an EASY way to create a "Country" dropdown field?
    I would also like to know when formcentral will support more input masks? I am not talking anything real elaborate here; just basic form 101 things like: phone number input, character limits in numeric fields, disallowing numbers for text fields (alpha characters only).
    I am extremely unhappy with having to upgrade from the trial to actually fully test drive the product, only to discover that these real basic features are not here.

    Hi;
    There is not an easy way to create a dropdown field of Countries without inputting them one at a time (or copying from another form).
    I'm sorry you felt you needed to upgrade, you did not need to "upgrade" to discover the features are not there.  This chart shows the features in the "Free" version and what the two paid levels include: https://www.acrobat.com/formscentral/en/features/compare-plans.html  In order to try a "Basic" plan we offer 99 cents for the 1st month of the subscription for you to give it a more in depth trial and test the paid features, but again the features you are asking about are not included in that list of paid features.
    I can't speak to whether or when those features might be added to FormsCentral.
    Thanks,
    Josh

  • Text input options missing

    Hi,
    After running some updates yesterday, the "show text input options" is no longer available in the options. Neither can I select suretype when writing a message. Would appreciate some help.
    Thanks
    Solved!
    Go to Solution.

    Had to re-boot after removing an application and everything back to normal! What bugs me is that my service provider tech never brought up a re-boot but rather wanted me to delete all my data and start all over!

  • How to make numbers in message text input  fields left aligned?

    Hi Friends
    I have completed one of my task .but getting result right side of the field.
    how to make numbers in message text input  fields left aligned?
    Thanks
    Aravinda

    Hi ,
    Sorry for late replay i am trying this alos not set that page....
    pageContext.forwardImmediatelyToCurrentPage(null, true, null);
    and one more that kff field working is fine for ex display any text pled displayed properly and only problem is not set the value and HrSitKeyFlex6 and HrSitKeyFlex7 fields are perfectly get the values but not pront HrSitKeyFlex8 that only my issue....
    Regards,
    Srini

  • Conditional for a text input box NOT being null? Sorry for asking so many questions!

    Okay, here's the situation. I'm creating a simulation of a form on which there are several text input boxes, 7 of which are mandatory fields. I know I can use a conditional to check whether the box has nothing in it by creating a null variable with no value and doing "if [box variable] is equal to [null variable] then", but the problem is that the validation captions I need to show need to be shown in order, that is to say that the caption for entering a value for the first box will always be shown if that box is null regardless of the contents of other boxes, the second will be shown if that one is null and the first one isn't etc.
    When I was investigating this I noticed a post by Lilybiri saying that comparison with a null variable doesn't work for "not equal to" so I'm having a hard time figuring out how to show the captions based on priority. For example, to show the second caption I need to not only check whether the second box variable is null, but also whether the first one isn't.
    It gets pretty crazy further along the line where I get to the 7th mandatory field and need to check whether the first, second, third, fourth, fifth and sixth boxes are NOT null and whether the 7th one IS. Help!
    I did come up with one potential solution to this prior to posting: if I set a different advanced action for each input box losing focus which checks whether the variable is null and if so sets a "flag" variable to 0, and in the else set it to 1, I imagine I can then replace the "not equal to" with a check to that flag variable being equal to 1 (which means there is text in the box). I think this will work but I thought I'd check to see if there's an easier way first.

    No it DOESN'T require everything to be on one slide.  It just has to LOOK as if that's what it is.
    I would suggest that it doesn't really matter how many Captivate slides are involved in the final solution, as long as it works the same way (or as close as possible) to the original software that you are simulating.  Your users don't frankly know or care how you achieved the simulation.  I guarantee they won't be thinking of you or Captivate.
    In my experience, you can make creating elearning a lot more difficult than it needs to be in Captivate by trying to rebuild the app, rather than just simulating how it works. For example, thinking that if everything happened on one web page or screen in the app then it must also happen on a single slide in Captivate.  The fact of the matter is IT DOESN'T need to work this way.  And in some cases it might even be impossible to reproduce in Captivate this way.
    So the quickest path to a solution is often to use multiple slides, which has the advantage of allowing you to "fix" certain things on screen (e.g. the contents of fields already visited) by using READ ONLY variable output in transparent captions, focusing only on one element of the interface that the user can interact with on that slide.  It doesn't necessarily prevent you from moving back and forth between elements, just as you can in the original app.  But it is far easier to create and maintain.
    I'm not saying you wouldn't be able to pull this off on one slide in Captivate, but it is going to require a LOT of variables and Advanced Actions to build and debug.  So the term Rapid Elearning becomes something of a misnomer if it takes you a long time to complete one slide.

  • Text input box for displaying notes

    How can I use a text input box so delegates can write notes in which then appear on other pages as they work through the course.
    Ken

    It seems you would be able to do this with user variables, in which you store the content retrieved from the Text Entry Box. Later on (other slides) you can use this content by adding it to a Text Caption. Beware: I'm not sure about the amount of characters that can be stored.

  • Text Input Prompt

    Does anyone tried to build some text input field that can do prompt? Something like auto-complete in source code edit. It would mean that:
    - we have to make the rest of the prompt text gray
    - the cursor blinks right after the user input characters
    - if user click space bar, the first word in prompt become solid and cursor moves to next word.
    Is this something that's possible to do for iPhone?

    - How do I programmatically place the cursor in the middle of a word
    - How do I font/color part of word in text input control
    - How do I select the text up to or from where the cursor is...
    You can't. You can't. You can't. At least not with a UITextField.
    I've done more or less of what you are looking for in PocketMoney for auto completing transaction. You need to do a lot of rolling of your own code to pretend you have UITextField.
    What I ended up doing is drawing the uncompleted text at the end of the current text input of the UITextField that I subclassed.
    - Hardy

  • Text input field

    How can I create a text input field?

    Ok, I found the solution by a lot of searching and trial and error:
    sym.$('#nickname').val("XXX");
    ..., where "nickname" is the id of the input field.

  • Text Input Autocomplete

    How do you make a text input control behave like a normal web
    form control that displays suggestion as you type in the control.
    I'm sure Flex can do this I am apparently looking in the wrong
    places. Any help would be greatly appreciated. Thanks so much!
    curtkauf

    The Adobe site has an Exchange section where there are many
    flex components, some are free, some are not.
    Here's one that does what you need
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1340 018

  • Text input variable

    How do i make a text input element have a variable ?.....I
    don't mean instance name ....i mean variable!

    I'd say you just don't do it that way, but to give more
    advice I'd need more info on what and why ...
    There should be a lot of solutions to your problen once it's
    nature is clearer.

  • Text Input: How To Perform Procedure on Console Input Without Variables

    Problem Defined:
    Need to analyze text input on console to ensure it meets conditional statements before assigning to a variable.
    I can't find a method to take scanner input from the console without first assigning it to a variable. I don't want to assign it to a variable unless it meets a certain condition.
    This is for a class assignment and I must use the console for input--no dialog boxes.
    This is what I want to do:
    Read Input; Hold In Memory; Test if Null; Test if Length is 14 Digits; Assign to Acct if All Conditions Are Met
    If Null, tell the user he needs to actually enter input or q to quit. Exit after five failures.
    If input is not equal to 14 digits, inform user. Offer escape with q. Exit after five failures.
    I only know how to assign a value to a variable from the various methods that take input. How do I take input and store it in memory to analyze without assigning it to a variable?
    I have this and the code is probably not correct. I'm a rank newbie. I've written several programs, but they're all basic, mostly using only the methods I learned in class and what I pulled out of books. My prof doesn't even intend on going over if, for and while! She's happy with us just copying verbatim and editing one or two lines so the source isn't exactly what she wrote on the board. I'm trying to learn how to do things that I know are useful, like making sure input is in the proper format, asking questions like what did people use before scanner just gets me blank responses with a quizzical look, but no answer.
    new Scanner = console scanner (system.in);
    String Acct
    Acct = console.next();
    if Acct == null . You entered nothing. Try again or press q to exit.");
    return to Line 1 //No idea how to do this.
    if Acct == 'q'
    Close Program
    if length.Acct = 14 ( Acct = Acct )
    else System.out.print("Your account number is 14 digits. You didn't enter 14 digits. Try again. Or press q to quit.")
    goto Acct = console.next
    Also, if you need to read an address from the console entered on one line, what methods can you use to pull one word at a time and then position them onto multiple lines?
    Enter Address: 123 Main Street Apt 321 Port View, FL 32547
    123 Main Street
    Apartment 121
    Port View FL
    32547
    Any help putting this together would be greatly appreciated. Thanks in advance.
    Alec

    805228 wrote:
    How do I take input and store it in memory to analyze without assigning it to a variable?Where do you think variables are stored? In memory. So no, you're not gonna be able to do anything to the value before you assign it to a variable. Then you can do any checks you need and
    possibly assign it to another variable (or more likely, ask the user for valid input if the checks don't pass).
    You can use loops and other constructs to keep asking for user input until valid values are provided.
    if Acct == null . You entered nothing. Try again or press q to exit.");
    return to Line 1 //No idea how to do this.Read up on while loops.
    Also, if you need to read an address from the console entered on one line, what methods can you use to pull one word at a time and then position them onto multiple lines?
    Enter Address: 123 Main Street Apt 321 Port View, FL 32547
    123 Main Street
    Apartment 121
    Port View FL
    32547Well that depends. How do you know that the street is "123 Main Street" and not "123 Main Street Apartment" or "123 Main Street Apartment 121".
    You can get the whole String from the user and then split the String into smaller Strings _if_ you can answer the question on the previous line.

  • Text input box to show in another text field

    Hello,
    I have a text input box (Text1) showing during a certain label on the stage.  On another label there is another text field (Text2) that is not input-able.  This second text field (Text2) should show whatever the user has inputted in the first text input field (Text1).
    Both of these elements are not symbols and right now they are both text elements.
    Does anyone know how to do this?
    Thanks,
    ~iana~

    I believe the inputField is set accordingly.  And including your reply, here's what I've got on my stage:
    sym.$("Name").attr('contentEditable', true);
    var inputValue = sym.$("Name").value;
    // other text
    sym.$("Signature").html(inputValue);
    Thus far, this does not work. "Name" field is Text1 (inputField) and the "Signature" is Text2 (text box)
    I'm new to all this so I've prob got something wrong...do you know what I should adjust?

  • Text Input header render lost focus on grid data refresh

    I have create a text input  type header render for datagrid as a filter.  On change event I am dispatching my custom event which refresh the datagrid from
    server side filter but in this the text input in which I am typing lost focus and gain it again on mouce click
    Alreadt tried setFocus and focusManager
    Thanks
    Abha

    I'd probably wait for updateComplete and then call setFocus again.  And/or
    use callLater to defer setting focus.

  • Text Input field return char problem

    I have a multiline text input field used as a message area on a form (sending mail through a PHP doc).  When I hit return to start new paragraph in that field and the form content is send and received at other end everything after that return is lost?  Any ideas would be fantastic...
    Marc

    copy the code between the dotted lines and attach it to the same timeline that contains your submit button:
    var sendLV:LoadVars=new LoadVars();
    var receiveLV:LoadVars=new LoadVars();
    receiveLV.onData=function(src){
    trace("received");
    trace(src);  // or use a textfield to see the return if you're not able to see trace output when testing
    // and you should attach code to objects.  assign an instance name to your submit button (say submitBtn) and use:
    submitBtn.onRelease=function(){
    sendLV.name = form.nameTF.text;  // assign properties to sendLV that your php is expecting.  assign values to those properties using the form data
    sendLV.email=...
    sendLV.message=...
    sendLV.sendAndLoad("email.php",receiveLV,"POST");
    trace("sent\n"+sendLV.message)
    and change your email.php file to:
    <?php
    echo $_POST['message'];
    ?>

Maybe you are looking for