How to set form 9 or 11 digits with dashes

Windows Adobe Pro 9.

Someone please be nice and have mercy on me, I have been studying this problem for 5 hours now and he can't solve mine.

I have a text field where the user will enter a digit 9 or 11 digits separated by dashes. If the entered number is 9 digits, it should appear as

XX-XXXXXXX. So 11 digits, it should appear as XX-XXXXXXX-XX. If a single entry of 9 digits, the XX - at the end must be omitted.

I found a javascript script that showed how to allow a variable number of digits, and I also found one that showed how the dashboard to enter, but I'm not smart enough to know how to combine the two. I've only used one other before javascript (the time format 12:00, with a gigantic thank you to Mr. George Johnson), so I know that I have to put the script ""Advanced > document processing > Document JavaScripts. ' " I think then I would go into the format of text field and select "custom" and enter a keystroke and script format?

Any help will be greatly appreciated.

Thank you

Alice

OK, here's two functions, you can add a JavaScript script to the document level and then call the events Format and typing in a text field, which has likely been defined to allow a maximum of 11 characters:

// Call from Format script
// Format entry to 99-9999999 or 99-9999999-99
function twoDash7Dash2_F() {

    // Get the value the user entered, as a string
    var s = event.value;

    // Do nothing if field is blank
    if (!s) return;

    // Only allow 9 or 11 characters
    if (s.length === 9 || s.length === 11) {

        // Determine the format string to use
        var fs = "99-9999999";
        if (s.length === 11) fs += "-99";

        // Display the formatted value
        event.value = util.printx(fs, s);

    } else {

        // Let the user know something is wrong
        app.alert("Please enter 9 or 11 digits.", 3);

    }
}

// Call from Keystroke script
// Limit entry to digits only
function DigOnlyKS() {

    // Get all that is currently in the field
    var val = AFMergeChange(event);

    // Reject entry if anything but digits
    event.rc = AFExactMatch(/\d*/, val);

}

If the script format for the field would be:

// Custom Format script
twoDash7Dash2_F();

And the script from typo would be:

// Custom Keystroke script
DigOnlyKS();

Tags: Acrobat

Similar Questions

  • How to connect Forms 6i and reports 6i with oracle 10g R2?

    Hey everybody,

    I need your help in linking the two Forms 6i and reports 6i with Oracle 10 g Release 2 db, MS Access(2003, 2007) and SQL database (Microsoft Visual Studio 2008). I am a newbie. I installed all the on my laptop HP with Windows 7 installed Ultimate(32 bit OS). I want to generate reports and forms by accessing data from databases mentioned above. Please provide me with the configuration steps.

    Thanks in advance...!

    Being new to the forum, I encourage you to consider the following before you post much more:

    http://blogs.Oracle.com/Shay/entry/10_commandments_for_the_otn_fo

    As for your question, I hope that you read my posts.

    As I mentioned, form/reports 6 is very old and operating systems, you suggested that you will use are very new. This version of F/R is obsolete and expected that it works on a new operating system is not realistic. Why are spending you time with such an old version? Even if you're just trying to learn the product, learning with an old version is probably not a good idea.

    The tnsnames.ora file, you need to update is this: c:\orant\net80\admin

    If you want to learn how to use the product in detail, you probably won't be able to do it in a forum. It is not as if we were trying to learn MS Notepad. Forms/States (and all Oracle products) are enterprise-level products. All products Oracle would require that you spend time to review documentation and in many cases attend some courses to always be effective using them. You can find documents and training in countless places, including within the site of the Oracle. I recommend that you consider that your place of departure.

    Here are some examples:

    Forms of technical documents for most of the versions:
    http://www.Oracle.com/technetwork/Developer-Tools/Forms/Overview/index.html

    11.1.2 of Documentation Forms Library:
    http://docs.Oracle.com/CD/E24269_01/index.htm

    Archived forms documentation:
    http://www.Oracle.com/technetwork/documentation/dev-arch-093406.html

    Oracle Forms - Oracle Education
    http://education.Oracle.com/pls/web_prod-PLQ-dad/db_pages.GetPage?page_id=501

    The forms and the report generator online help is also a good place for more information that in some cases, the sample code is provided.

  • How to set the clock as a Digital Out Signal in the C API?

    My problem is simple, I'm looking for a way get the my device of the series E clock signal (6254) to a digital camera offline. Is it possible to do in the C API? If yes are there docs everywhere where show me how do?

    Hi neurostu,

    Yes, there is a way. The function is called DAQmxConnectTerms. "" "" "You can find the definition of the function in Start ' programs ' National Instruments ' NOR-DAQ' text Code support" using NOR-DAQmx C reference. "" "On the left, select OR DAQmx C functions" advanced"routing of the Signal'. DAQmxConnectTerms

  • Beginner: How to set the label of the digital control programmatically?

    I have a digital control and I want to put the labels (and unit) programmatically. I've created a property for the text of the label node, and then it changed to a knot of Scripture. For now I have just son a constant in this property. When running I get the error "input unit is not compatible with the current unit." However, the property and the constant are strings "roses." Is what I'm trying to do possible? My apologies in advance for a noob question.

    You will not be able to change the value of the property label programmatically. Here is an article in the knowledge base that explains this and a way around:

    Programmatically change the label for a control or the indicator in LabVIEW

  • How to set the size of plot-legend with properties?

    Hello

    in the screeenshot I create 10 plots that are displayed in a xy chart.

    According to the number of plots of the legend is updated.

    How can we set the legend is highest of 5 plots and other plots 5 (or more) is visible if you are using the scroll bar?

    Thank you

    Solved.

    Name of the property is under: legend + size + high

  • How to set up Windows Fax and Scan with Brother MFC-7440N printer/all-in-one

    Hello, I'm trying to set up Windows Fax and scan using my all-in-one Brother MFC-7440N printer/fax/scanner.

    When I go into the Windows Fax and Scan menu, I'm going to Fax > tools > accounts Fax. Then I select 'Add '. When he asks, I then select "Connect to a fax on my network server." But I don't know the name of my printer/fax/scanner when he asks "Type the fax server location."
    How to find the name?
    Help, please! Thank you!

    Hello

    You can include the MFC-7440 printer named fax in the \\IP addressname of \\Printer' and check.

  • How to set the value of a * APPLICATION * with apex.server.process?

    If I have a page named point P1_MY_PAGE_ITEM, I could put its value in the session by doing this:

    $s('P1_MY_PAGE_ITEM', 'I Like Pie!');
    
    apex.server.process(   'dummy'
                           , { pageItems: "#P1_MY_PAGE_ITEM" }
                           , { dataType: "text",
                             async: false,
                               complete: function( ajaxResponse )
                                     {
                                          var ignoredReturn = ajaxResponse.responseText;
                                     }
                             });

    Which works very well. If you check the session, the P1_MY_PAGE_ITEM will now have the value: I like pie!

    However, if I have an Application element (not a page element!) named MY_APP_ITEM, how could I do the same thing? How can I use apex.server.process to set the value of MY_APP_ITEM in the session? I wouldn't be able to use "pageItems" because MY_APP_ITEM is not a page element, it is a part of the application.

    What is the correct syntax to do this?

    Thank you

    -Joe

    Hey Joe,

    Returning to that thread you made a couple of months ago, the answer is here:

    Post adjustment Application items in the apex.server.process for a * process application *.

    Defining a point of application is as easy as providing the name of the application element to p_arg_names Bay and set a corresponding value in the p_arg_values table.

    For example, in an application with article SOME_ITEM of the application, I can put the value as follows:

    (function(){
    var arrNames = [], arrValues = [];
    arrNames.push("SOME_ITEM");
    arrValues.push('some value');
    apex.server.process(   'dummy'
                         , { p_arg_names: arrNames, p_arg_values: arrValues }
                         , { dataType: "text"
                           });
    })()
    

    Any required application process. Should the item be free that you set it from the browser.

  • How to set a vCPU nuclei in VM with the cmdlet Set - VM

    Hello

    I am using PowerCLI for VM config in ESXi 5, I know how to change the number of vCPU to a virtual computer by using the following command: virtual machine Set - VM "myvm" - numCPU 2. However, now I want to put the kernels in a vCPU and I read the whole-VM use help: Get-Help-Set-VM-detailed, but he has mentioned anything on this subject.

    y at - it access for me set the number of cores?

    Thank you Daniel.

    Hello, DanielLeeDL-

    There was just a question yesterday about it.  You can very easily change the number of cores per socket using the v5 API example in this thread at: http://communities.vmware.com/message/1891250

    How does do for you?

  • How to set a variable to a string with special characters?

    I want to set a variable

    < cfset inputstring = "< img src ="... /... /.. "/ Server/Win/Form/Stamp/string_1" / > "/ >"

    but I get the error message:

     Invalid CFML construct found on line 184 at column 32.
    ColdFusion was looking at the following text:
    
    
    .
    

    I try different ways, what I am, I am doing wrong?

    You must escape the inner quotes or mix single and double quotes.  Try:

    "/>

    or

    Oh, and oblique aft are not necessary in the tag.

    -Carl V.

  • How to set up the keys on Toshiba with WinAmp on Portege M800

    Hello

    any ideas how to map the keys shaded on M800 (next, reading, etc.) to other media player software?

    Thanks for the info on [email protected]

    Hello

    AFAIK you cannot configure keys like play, stop, forward with WinAmp.
    All applications that might make are not known to me.
    The buttons are configured with WMP (windows media player).

    See you soon

  • How to set up Wireless Manager for use with the SIM (NB100-12i)?

    I just bought the NB100-12i which comes with a SIM card slot. The system is WIndows XP SP2.
    SIM card is recognized (at least it says screen diagnostic wireless managers etc.). But I can't get a connection. After entering my PIN there is nothing happens. The sender can not be activated.
    I have an Orange SIM card with data option and the SIM card works in my phone. How can I use in my brand new Toshiba NB100-12i?

    Well, seems that the thread has responded ;)
    Thanks for sharing this with us!

  • How to set the parameters of the AKD with LABVIEW driver?

    Hello

    I am looking for a simple example to set or read the AKD with Labview driver settings.

    The AKD has ethernet communication and control is analog - AKD-P00306-NBAN-0000

    I want to use Labview to read the paramerters even as Kollmorgen WorkBench

    Thanks for your help

    Thank your for your help

    I found a solution with the TELNET Protocol

  • How to set to lock the application landscape with already zoom.

    I use the webworks sdk, how to lock your mode application landscape with already zoom. ? Thank you

    https://developer.BlackBerry.com/HTML5/documentation/working_with_config_xml_file_1866970_11.html

    You must update this line

    "orientation"value="portrait"/>

  • How to set LR to highlight the folder with bright color choices

    In the free tutorial of Laura Shoe "Reorganize your files and Photos The Easy Way" Laura shows us how to move folders in the folder images go here (for the first 3 minutes). When she does the destination folder will turn BLUE. My LR doesn't do this thing of blue, and I wish that he, because gray "highlight" is very dim (barely perceptible). I think it take a bright color would prevent mistakes when drag & drop, or travel in other files. How can I fix my LR do this blue highlight on my PC? Laura thought it was only an option under Mac. I hope this isn't the case.

    [personal information deleted by mod]
    As

    Love

    Haha

    Wow

    Sad

    Angry

    Comment

    Laura's right.  The blue light is a feature provided by Mac OS X using the LR; There is no equivalent in Windows feature (although LR could implement itself quite easily).   See this topic for more details: Re: change the color of the toolbars and panels

  • How to set the keys to line declared with a model of ChildPropertyTreeModel

    I want to initialize my tree with a few nodes already developed. From what I read I have to use the setDisclosedRowKeys method, but I don't know how to create and fill the parameter RowKeySet.

    I was thinking something like this:

    RowKeySet rowKeys = tree.getDisclosedRowKeys ();

    = (ArrayList) model.getWrappedData () ArrayList object.

    TreeItem data = (TreeItem) object.get (0);

    List of children < TreeItem > = data.getChildren ();

    for (TreeItem element: children) {}

    Code to add this element to the RowKetSet

    }

    tree.setDisclosedRowKeys (rowKeys);

    There is a RowKeySet.add () method, but it refers to the current line, and in my case, there is no "current line" concept. Any idea on how to fill the RowKeySet?

    JDev 11.1.1.6.0

    My working solution:

    @Override

    public void expandDefaultNodes() {}

    FacesContext context = FacesContext.getCurrentInstance ();

    RichTree tree = (RichTree) context.getApplication () .evaluateExpressionGet (context, "#{components.tree}",)

    RichTree.class);

    ArrayList<>> newKeys = new ArrayList<>> ();

    RowKeySet disclosedKeys = tree.getDisclosedRowKeys ();

    Object oldkey = tree.getRowKey ();

    tree.setRowKey (null);

    TreeModel treeModel = tree.getValue ((ChildPropertyTreeModel));

    RKS RowKeySet = new RowKeySetTreeImpl();

    rks.setCollectionModel (treeModel);

    rks.addAll ();

    for (k subject: rks) {}

    ArrayList = k (ArrayList) keyAsList;

    First layer

    If (keyAsList.size () == 1) {}

    newKeys.add (keyAsList);

    }

    treeModel.setRowKey (k);

    TreeItem ti = treeModel.getRowData () (TreeItem);

    If (ti.isSelected ()) {}

    for (int i = 1; i)< keyaslist.size();="" i++)="">

    Subkey is used to disclose the parents of the current

    node

    Subkey list = keyAsList.subList (0, i);

    If (! newKeys.contains (subKey)) {}

    newKeys.add (subKey);

    }

    }

    newKeys.add (keyAsList);

    }

    }

    tree.setRowKey (oldkey);

    disclosedKeys.addAll (newKeys);

    AdfFacesContext.getCurrentInstance () .addPartialTarget (tree.getParent ());

    }

Maybe you are looking for

  • Guided access

    I know that on some versions of the iPad mini guided access support and I want to know if guided access is still supported on newer iPads as the iPad Pro. If you know please answer. Thank you!

  • Satellite Pro L450D - 12 X - no function key FN + F8

    Hi all After having reinstalled Windows 7 SP1 on my laptop of friends the Fn + F8 function does not work. Wireless stays on at the start of the system and will not be extinguished. Other combinations of Fn keys work well, IE sound and screen brightne

  • How can I create a great picture with just a few numbers in there?

    Treat all I would appreciate if you can help me with this problem. I would like to highlight certain points on a diagram that its horizontal size is 1000. so I create another table with the same size of the main diagram that contains my points you wa

  • As the ONLY USER of my VISTA PC how do I boot directly to my desktop?

    I am the only user of my Vista Ultimate PC.  What are the directions that allow me to direcfrly Boot on my desk is by avoiding the user screen. NOTE: I found the directions of last year in a magaszine PC and used them - worked perfectly.  However, si

  • "D" created automatically during the installation of Win 7?

    Hello My wife has a Toshiba laptop, bought refurbished, with Win 7 Home Premium installed. Windows Explorer shows 2 partitions on the hard drive, "WINDOWS(C:))." "has the OS installed on it and"Data (D :) '. "has the necessary information, when used