How to format 9 or 11 digit number with dashes

Windows Adobe Pro 9.
Someone please be kind and have mercy on me, I've researched this issue for 5 hours now and cannot resolve it on my own.
I have a text field where the user will enter either a 9 digit or 11 digit number separated with dashes. If the number entered is 9 digits, it should appear as
XX-XXXXXXX. If 11 digits, it should appear as XX-XXXXXXX-XX. If only 9 digits are entered, the -XX at the end must be omitted.
I found a javascript that showed how to allow a varying number of digits, and I also found one that showed how to cause the dash to be entered, but I'm not smart enough to know how to combine the two. I've only used one other javascript before (how to format the time 12:00 am, with a gigantic thanks to Mr. George Johnson), so I know that I must put the script in "Advanced > Document Processing > Document JavaScripts." I think then I would go into the text field format and select "custom," and enter a keystroke and format script???
Any help will be greatly appreciated.
thanks
alice

Hi Mr. Johnson,
When I copied the first part of the code into the document-level javascript editor box and hit okay, it gives this message:
SyntaxError: return not in function
8: at line 9
and the cursor moves to the empty line after:
   // Do nothing if field is blank
    if (!s) return;
Is there something missing?
I really appreciate your help.
alice

Similar Messages

  • How to get the 4 digit number associated with a SAP icon ( ICON_MAIL )

    Hi Friends,
                   Could anyone please tell me how to get the 4 digit number associated with a SAP icon ( ICON_MAIL ).
                   eg: - For ICON_GREEN_LIGHT the four digit id code is '@08@' (which you can get from ICON table )and the associated 4 digit number is'1003'.
                  Similarly I want to get the 4 digit number for ICON_MAIL(e-mail icon)
    <b><REMOVED BY MODERATOR></b>
    Ashiq
    Message was edited by:
            Alvaro Tejada Galindo

    You can use this report...It's not mine...
    REPORT zdummy_atg_2.
    TABLES: ICON.
    INCLUDE <ICON>.
    FIELD-SYMBOLS: <F>.
    SELECT * FROM ICON.
       ASSIGN (ICON-NAME) TO <F>.
       WRITE:   /(5) <F>, 20 '@',21 ICON-ID+1(2),23 '@',ICON-OLENG,
                ICON-BUTTON,ICON-STATUS,ICON-MESSAGE,ICON-FUNCTION,
                ICON-NAME.
    ENDSELECT.
    Greetings,
    Blag.

  • My 3rd iphone. 3GS I did not buy from an apple store, how do I register this serial number with my apple account? it is already sync to it and will preform every function except email to my home computer. It says apple ID disabled

    My 3rd iphone is a 3GS. I did not buy this one from the apple store, how do I register this serial number with my apple account? it is already sync'd and it and will preform every function except email to my home computer. It says apple ID disabled, also will not update my apps, same promt apple id disabled.
    anyone know where I can go to register this phone? Thanks

    https://register.apple.com

  • How do I redeem my serial number with my redemption code ?

    How do I redeem my serial number with my redemption code ?

    Try http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • How do I pair phone tocar phone?  How do I enter four digit number?

    How do I pair iphone 5s to car phone?  How do I enter four digit number?

    It can depend on the device. Some have you respond on the phone, some on the particular device. My vehicle had me respond on the vehicle. Follow the instructions for the particular device that you are using.

  • How to append calling and called number with translation rules?

    Hello,
    I have one question about digit manipulations.
    How to append calling number and called number with IOS commands?
    For example, when 123 dials 45678, translations have to be performed and the new called number to be 12345678.
    Thank you,
    I will vote this conversation.

    It is not possible with translation rules.
    However, you can do that with a TCL/IVR script.

  • I have set up a iTunes account but I have changed my number and now I can't download apps it keeps saying previous billing problem how do I change my phone number with out setting up a new iTunes

    How do I change my phone number on iTunes. On my phone just I can't download any apps due to a problem with the numbers not matching

    You're really posting in the wrong forum. you should be posting here ( https://discussions.apple.com/community/itunes/itunes_store ) Or calling apple support directly.

  • How do you specify a line number with getline() (c++)

    How do you specify which line for getline() to read with c++ similiar to how awk uses $1, $2, $3 , etc etc...
    Example:(Ignore the underscores)
    Line1 Line2
    10____10
    20____20
    30____30
    40____40
    if I were making a program to remove 10 on the first line and 20 on the second line how would I tell getline which line to read
    Example source code:
    #include <cstdio>
    #include <fstream>
    #include <string>
    #include <iostream>
    using namespace std;
    int main()
    string line;
    string line2;
    ifstream in("/Users/lundquisted/Desktop/infile.txt");
    ofstream out("/Users/lundquisted/Desktop/outfile.txt");
    while( getline(in,line) )
    if(line != "10")
    out << line << endl;
    while (getline(in,line2) )
    if(line2 != "20")
    out << line2 << endl;
    in.close();
    out.close();
    remove("/Users/lundquisted/Desktop/infile.txt");
    rename("/Users/lundquisted/Desktop/outfile.txt","/Users/lundquisted/Desktop/inf ile.txt");
    return 0;
    }

    Eric Lundquist wrote:
    store the output of a system() command within a c++ program to a string and/or variable
    A number of apps call Unix utilities and capture both stdout and stderr, typically for viewing in a log window, but for other uses as well. Xcode, for example, starts up gcc and does various things with the text that gcc might otherwise print in a Terminal window. Most apps that rely on Unix commands that way don't use "system()", which is a rather crude way of launching utilities that leaves the parent program with very little control. Usually, the best way to manage helper utils from a Cocoa app is by using NSTask and NSPipe. If you spend some time with the two following pages, you'll learn how to do almost anything you want with command line utils from inside a Cocoa app:
    [http://www.cocoadevcentral.com/articles/000025.php]
    [http://macosx.com/forums/archive/t-3927.html]
    The first link goes to a great tutorial on using NSTask. Capturing stdout and stderr are only covered briefly towards the end, however. Note the last comment explaining why "system()" is a bad idea.
    The second link goes to a forum thread. Scroll down to the code posted by "blb" for some very clear examples of launching with NSTask and reading the output with NSPipe.
    If you really want to use a shell command, you could give NSTask a command like ' +bash -c "ls -lt | grep drwx"+ ' (see how setArguments: is used in the tutorial).
    If you just want to do something cheap and dirty with "system()" so you can see some awk output while you're learning how to do things the right way, I guess you could do something like this:
    system(" cat ~/random.txt | awk '{print $2}' > MyFile.txt");
    NSString *myString = [NSString stringWithContentsOfFile:@"MyFile.txt"
    encoding:NSUTF8StringEncoding error:nil];
    Of course you can just read MyFile.txt into cin if you're not using Cocoa.
    - Ray

  • How to enter a 24 digit number into a mysql db

    hi,
    i want enter a 24 digit number into a mysql db as a mathematically manipulatable value.
    when i configure the field as a bigint(24) it takes it as bigint(20)
    when i keep it as bigint and parsing a double value from my application
    it gives data truncation exception for the particular field.
    the whole process worked well when i change the field type to varchar(24),
    what i want is to enter 24 digit number into db as a mathematically manipulatable value.
    if anyone can assist me, pls reply,
    thanks,
    dushi

    you should ask in a mysql-forum. or at least in JDBC-forum here at sun-forums
    you could save it as varchar and parse it when selecting it into bigint in java and make your calculations...

  • How to suppress n/m in FSG with dash

    Hi,
    I want to suppress n/m for all my custom FSG reports with dash.
    Any Idea how i can do this??
    Thanks,

    I was looking for the same thing - here is what I found.....
    21. What is the meaning of ‘n/m’ on my FSG?
    The means ‘no meaning’. FSG displays this when there is a calculation that is attempting a divide by zero. You cannot remove this, or change it to any other value (other than changing the calculation itself so it doesn’t result in a divide by zero).
    http://oraclefinancial.wordpress.com/2011/01/02/fsg-functional-faq/

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • Moving home - how can I leave my phone number with...

    Hi all,
    I've searched but not found an answer to this one. I want to:
    1) Move my phone line to a new property 
    2) Set up a new account for the current property (for someone still living there)
    3) Move my current phone number, to the new account, on the current property.
    To be clear - I don't want to move my phone number to my new property. I want to move my phone number to a new account - held by someone else - on the existing property.
    My question: what is the best way of arranging this? Can BT provide account management for a complex move?
    Read on for gory details of how we find ourselves in this mess.
    A short history - how I lost my partner's father's phone number
    A few months ago, my partner and I moved in with my partner's father (hereafter: PF) while we prepared to buy a new property. At this point we had no property to move our still-in-contract BT package to.
    BT told us that to prevent a large charge for the remainder of our minimum term period, we should move the account to PF's house, but keep 'putting off' the installation until we had a new address to have the service re-instated.
    When it came close to the original installation date (you can specify a maximum of a couple months from move date), I asked BT to 'put off' the installation by a few weeks. They obliged. 
    What BT didn't mention was that the current account holder (PF) would automatically have their line/number disconnected, and account closed, on the orginal installation day. My 'putting off' of my installation day had no effect on the disconnection, thus PF was left without a working phone. Worse, the phone number (held for ~20 years) was lost.
    After much wrangling with BT, we managed to get my line installation expedited, and PF's phone number attached to my line.
    The current state: PF has no BT account. I have the same BT account I've always had, but with PF's phone number.
    My partner and I will move out ASAP. PF wants to have his own BT account, and his own phone number. If necessary, I can close my BT account.
    Thanks for reading!
    My life is in your hands lovely BTCare people (you should meet PF...)
    Andrew

    Hi drewg,
    Welcome to the Forum and thanks for posting. I can look into this for you. Drop me an email with the details. You'll find the "contact us" form in the about me section of my profile. Once I have the details we'll take it from there.
    Cheers
    David
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • How can i get kinect serial number with KinectSDK1.8

    Now I'm getting depth datas and color datas from 4 Kinect with Kinect SDK 1.8.
    I use Windows 8, Visual Studio 2013, Kinect SDK 1.8 and Kinect v1 × 4
    /***** getINuiSensor Instance *****/
    INuiSensor* sensor;
    HRESULT result = S_OK; // device_id : 0~3
    result = NuiCreateSensorByIndex((int)std::stoi(device_id),&sensor);
    But this way, the couple of the Kinect and "device_id" 
    such as the order of the device connection is changed.
    Therefore, in order to specify the device to start more explicitly,
    I would like to know how to get the serial number of kinect on Windows.
    I know the way that There is a way to get INuiSensor Instance 
    by a serial number getting from the device manager with OpenNI.
    With Kinect SDK, how to get the INuiSensor Instance using the serial number ?
    If Kinect SDK have no way it, please tell me some good ideas about that.

    The serial number is printed on the sensor. We do not provide an api that gives you the serial number of the device.
    As for the api you are using, that will only provide a unique identifier for the port the device is connected to. Plugging in another Kinect device to the same USB2 port will get you the same value. See other threads that discuss this.
    There is nothing at a Kinect SDK level that will allow you to identify the exact device. You may need to look at Win32/OS level api's to see what is exposed through the raw driver. A tool to query the device that will let you see what these api's can provide
    is USBView.
    Carmine Sirignano - MSFT

  • How to format a pc external drive with a mac

    Hello everyone! It's about a week I've bought a new imac. I used to have a pc. I have an WD external drive which was not compatible with macs, I am trying to format it using the disk utility and choosing Mac OS extended (journaled). When I am trying to erase it, I always get the following message: 'Disk erase failed with the error: couldn't unmount disk.   I really need your help people, because I'm new to macs and I have already spend hours googling on that...
    Thank you in advance for your response..
    My operating system is Mac OSC (10.7.3)

    It seems so ironic, but I have just found the answer to my question. I saw a movie which was stored in my WD hard drive yesterday and I hadn't quitted quick time. When I quitted quicktime I was able to erase the disc. I apologise for that people!!

  • How can I move to row number with a search Query

    Hi everybody,
    Does anybody know how can I located a record in a multiple block, with a SQL sentence, using bind variables.
    Thanks in adviced

    Welcome to the Apple Discussions!
    Unfortunately, since Front Row has no preferences you can actually change, there's no way to change the screen now. (Besides the work arounds you've already discovered.) I would send Apple some Mac OS X feedback (since Front Row is considered part of OS X, not a stand-alone application) and let them know you'd like to be able specify the screen. You're not the first person here to ask for that option.
    http://www.apple.com/macosx/feedback/
    -Doug

Maybe you are looking for

  • In-Browser Elevated Permissions Setup with SL5 Issues

    I am having a devil of a time setting up in-browser elevation with an application I'm developing for a client. Software's purpose: Download excel, docx and other writable files to a user's system, launch the file in the default viewer, let the user e

  • Fiori Approve Requisitions error - unable to start app

    Hello Experts, We have implemented the UIX01EAP (SAPK-10002INUIX01EAP) Fiori component. I have followed the link Approve Requisitions. I have activated the OData Service GBAPP_PRAPPROVAL, activated the UI5 application MM_PR_APV, assigned the Business

  • Does a connector from the Solo 15 to MacBook Pro exist?

    Is anyone familiar with the Solo 15 from Brunton? If so can you let me know if an appropriate connector for a MacBook Pro exist? I've been trying for years to connect my Mac to Brunton's SolarRolls without any success. Now I'm thinking of getting Bru

  • Font book or CS2 font problem?

    I am using a mac Pro, running OS 10.4.11, w/ CS2. I am having a problem with either font book or CS2. Certain fonts are not viewing correctly when I use them in CS2 programs. I get a font error when I open the file, and when I try to fix the font by

  • Pass parameter to success method of ExecuteQueryAsync

    I have seen how to pass a parameter to a callback method of the ExecuteQueryAsync SP.ClientContext object.  The problem occurs when multiple calls are performed.  The last value is always passed to the callback method.  Below is a sample of a while l