Can I make a special character appear when typing? (Part 2)

Hi there
I am now working on an extended version of the issue describes in this thread: http://forums.adobe.com/message/3147856#3147856
The new field should hold digits in the format 9999-99999-99999-99, and I would like the hyphens to appear automatically when typing. I tried to modify the script I used before, but I can't get it to work properly. Can someone tell me, what I'm doing wrong?
My modified script looks this way:
if (xfa.event.change.match(/[0-9\-]/) == null)
    xfa.event.change = "";
if (xfa.event.change == "-" && xfa.event.selEnd != 4)
    xfa.event.change = "";
if (xfa.event.change.match(/[0-9]/) != null &&
    xfa.event.newText.length == 5 &&
    xfa.event.selEnd == 4)
if (xfa.event.change == "-" && xfa.event.selEnd != 10)
    xfa.event.change = "";
if (xfa.event.change.match(/[0-9]/) != null &&
    xfa.event.newText.length == 11 &&
    xfa.event.selEnd == 10)
if (xfa.event.change == "-" && xfa.event.selEnd != 16)
    xfa.event.change = "";
if (xfa.event.change.match(/[0-9]/) != null &&
    xfa.event.newText.length == 17 &&
    xfa.event.selEnd == 16)
    xfa.event.change = "-" + xfa.event.change; } 
    var vMax = 16; if (xfa.event.newText.indexOf("-") != -3)
    vMax = 19;
But it only makes the hyphen at 17th character appear automatically.
I hope to hear from you.
Kirstine

I found the answer here:
http://forums.adobe.com/message/2766333#2766333

Similar Messages

  • Can I make a special character appear when typing?

    Hi everybody.
    I have a form with a text field provided with a validation script, which allows the user only to enter values in the format 999999-9999. The script is places on the exit event.
    var myRegex = /\d{6}\-\d{4}/;
    var
    singleDigits = [0,1,2,3,4,5,6,7,8,9];
    If the format is not correct, the user will get an error-message.
    Now I would like the hyphen to appear automatically when typing. That means when the user has typed 123456 it will display as 123456-, ready to enter the last four characters.
    Is that possible.
    Kirstine
    P.S. I know I can make that (almost) happen if I make the field a numeric field, but for several reasons this is not an option.

    Here is a little script that can do what you are looking for..
    Place the script in the Change event of the Text Field and set the Max chars property to 11 for the Text Field.
    // restrict entry to digits and a dash
    if (xfa.event.change.match(/[0-9\-]/) == null)
        xfa.event.change = "";
    // Allow the hyphen at the 7th character only
    if (xfa.event.change == "-" && xfa.event.selEnd != 6)
        xfa.event.change = "";
    // If the 7th character is a digit, and they're typing at the end, insert the hyphen
    if (xfa.event.change.match(/[0-9]/) != null &&
        xfa.event.newText.length == 7 &&
        xfa.event.selEnd == 6) 
        xfa.event.change = "-" + xfa.event.change;
    // don't allow any characters past 10 (11 with a hyphen)
    var vMax = 10;
    if (xfa.event.newText.indexOf("-") != -1)
        vMax = 11;
    Thanks
    Srini

  • How can I make the comments field appear when the operator is debugging a test?

    When a test is being written the comments field is being utilized for information relating to what the test is doing and how to solve certain problems that arise. It is basically a quick place for the technician to look at when they are attempting to debug a board. However it appears when you view the sequence files these are off to the right side of the screen but when running the debug engine and the technician sets a break point then these comments are no longer visible to the user off to the right of the screen. Is there any way to have it include the comment in the data displayed when tracing through a test step by step. The technician can double click on each step but it would be alot mor
    e user friendly and timly if these could be displayed just to the right of the execution flow column.

    Hello John,
    I assume you are talking about the sequence editor. Unfortunately, there is currently no way to view the comments associated with a step inside of the execution display window (i.e during run-time). If you are using the operator interface, then you may extract the comment associated with a step and post a custom UI message that contains this information. The operator interface can then be modified to respond to this UIMessage and update its display accordingly.
    To post a UIMessage with this data, you must first obtain a PropertyObject reference to the step you are trying to extract the comment from. Then use the "Comment" property of the PropertyObject class to obtain the comment value.
    Unfortunately, the Sequence Editor discards all custo
    m UIMessages, and you will have no way of viewing the comment using the above method.
    Hope this helps.

  • How can I make my phone number active when viewing from a mobile device. My phone number is in my header in CSS

    How can I make my phone number active when viewing from a mobile device. My phone number is in my header in CSS

    See this support document http://support.apple.com/kb/HT5661

  • HT1600 I have an Apple TV 2nd Gen, iPad 2 and can't get the icon to appear when i swipe from left to right. What am I missing? I am able to get the 'Home sharing' 'user and password on my Mac.

    I have an Apple TV 2nd Gen, iPad 2 and can't get the icon to appear when i swipe from left to right. What am I missing?
    I am able to get the 'Home sharing' 'user and password on my Mac.
    Also using IPad 2 I am able to get the ITunes to accept the user name and same password as the Mac.
    However, the only way I can see the 'Home sharing; icon is in Music on the Ipad. When I tap on the Icon it asks for a password.
    When I give the same password, it is rejected.
    Help!!!!
    Jaxxdiggs

    Personally I think the iOS devices are poor at reconnecting  - Airplay establishes that a link is available but when the iPhone/iPad has been away from the house and rejoins the network i think AppleTV already thinks it's connected with a different IP address and fails to recognise it has joined the network again with new credentials.
    Something along those lines anyway.
    I find that a combination of restarting AppleTV, router and iOS device tends to fix it, but not for everyone.
    AC

  • HT204380 How can I make the screen full screen when I am calling?

    How can I make the screen full screen when I am calling on Facetime on a Macbook Pro Laptop?

    Ok but if the iPhone 5s and 5 can go full screen the why can't the iPad Air as it too is new the problem shouldn't be hard to solve as I have looked the apple site and it show it just fine in full screen so I'm sure you understand when I say there is most definitely away of doing it so can Apple just sort it out I'm always telling my m8 how good Apple devices are and I've been let down on this so come on fix it PLEASE

  • Please help me how can i make my app store because when i open it it says cannot connect to iTunes please if you have any helpful solution inform me

    Please help me how can i make my app store because when i open it it says cannot connect to iTunes please if you have any helpful solution inform me

    Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing will be reset
    Message was edited by: Diavonex

  • Can I make media sharing always enable when wifi is off?

    Hi all,
    Can I make media sharing always enable when wifi is off?
    or can i make media sharing automatically enable when wifi is on?
    By the way my device curve 9220 OS 7.1
    Thanks for your answer ^^

    Duane wrote:
    In Sharing I have 'Printer Sharing' turned ON
    In Print & Fax I have 'Share this printer' checked
    If you are describing the settings in System Preferences on your iMac, you need to turn those OFF. Your current setup has the iMac acting as the print server.
    Instead you want to rely on the Time Capsule to do the printer sharing. You would configure that using AirPort Utility.
    Thanks Duane, that bit of information did the trick. All I had to do was turn printer sharing off in sys prefs and it now works the way I thought it should work.
    Once again thanks so much for the help.

  • When using Mavericks, how can I automatically replace 'i' with 'I' when typing?

    When using Mavericks, how can I automatically replace 'i' with 'I' when typing?
    It was easy to do prior to mavericks using system preferences (language and text), but now I can only submit a 2 letter word to replace, not a 1 letter word. I have tried using a space but it doesn't allow that. I would assume that most people would love to be able to type quickly without having to make uppercase I all the time (first world problem i know), so I can't understand why apple have removed this feature.

    There is the shift key, or text replacement approach, providing you have enabled two things:
    Edit > Substitution > √ Text Replacement
    System Preferences > Keyboard > TextClick + to add a replacement
    Replaceii[spacebar]
    With
    I[spacebar]
    Press return
    Quit System Preferences
    Now, when you type ii, you will see a pop-up offering I.
    In the OS X App Store, search for WordService. This free collection of Services will enable you to just type your content, select it, and then choose the Service item, “Initial Caps of Sentences.” It does what it says.

  • Please help-how can I find accents on the keyboard when typing in French?

    Please help.How can I find accents on the keyboard when typing in french?Thanks

    You can also open the Keyboard Viewer & hold Option key & Shift+Option to see...
    Option key...
    Shift+Option or alt key...

  • In phone contact I don't get a keypad when trying to search, edit or add contacts how can I make the key pad appear?

    Since updating with 7.1 I no longer get a keypad appearing when I try to search, edit or add contacts in the phone - how can I get the keypad to appear?

    Hello there, English Springer Spaniel.
    The following Knowledge Base article offers some great steps for troubleshooting an app that isn't performing as expected:
    iOS: Understanding multitasking
    http://support.apple.com/kb/ht4211
    If an app doesn't respond to your input, or doesn't perform as expected, do the following, testing after each step:
    Check for app updates.
    Force the app to close.
    Restart your device.
    Update your iOS device.
    Learn more about troubleshooting apps.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Can't add text to photo. text doesn't appear when typeing.

    I can't add text to photo. The Horizontal Text Box appears but when typing there is no text seen. There is a cursor line which appears outside the text box.

    Please change the size of text and make it smaller.
    Regards,
    vaishali

  • Reg: Special Character Appearing in Excel O/P.

    I am getting excel output generated via an Oracle report (CSV format). In the excel output, I am getting a special character for TAB (Chr9, a box). Since user wants to sort the data, because of this character they are not able to sort data in sheet properly.
    Can anyone suggest what could cause this special character to appear in the report output? I am looking from layout perspective also. Is this has something to do with the printing style applied to the concurrent program?
    Thanks In advance.

    I had the same problem and this is what I did, works great. You have the total control.
    function BeforeReport return boolean is
    fp text_io.file_type;
    begin
    -- creating a file name
    :CP_filename := 'C:\Gap'||to_char(sysdate,'MMDDYYHHMISS')||'.csv';
    -- Opening the file in write mode
    fp := text_io.fopen(:CP_filename,'w');
    -- writing the column headings into the file
    text_io.put_line(fp,'"Platform","Sys#","GapType",');
    text_io.fclose(fp);
    return (TRUE);
    end;
    and then where ever it is suitable, depending on the requirement, write into file by opening it in the append mode.
    function R_G_systemplatformFormatTrigge return boolean is
    fp text_io.file_type;
    begin
    --     srw.message(99,:dname);
    fp := text_io.fopen(:CP_filename,'a');
    text_io.put(fp,'"' || :systemplatform || '",');
    text_io.put(fp,'"' || to_char(:sysno) || '",');
    text_io.put_line(fp,'"' || :CF_gaptype || '",');
    text_io.fclose(fp);
    return (TRUE);
    end;
    This works great. Hope this helps.

  • How to make cost element field appear when create network activity service

    Hi All,
    Please help. We create a project ,wbs and network activity using external service. How can we make appear the cost element when the service master appear. The system require cost element but we cannot see the cost element field.
    Steps :
    *. CJ20n.
    *. Create WBS and network header
    *. Then network activity for external service.
    *. Then it appears service specifications : ext specs Task List Maintain
    *. I Put Service no, and the error message appears :
    Please enter a cost element
    Message no. SE121
    *. But we can find where the cost element is. It seems the field disappear.
    PLease help.
    Thank you.
    Nies

    Hi,
    Yes. It is already blank. But the cost element field still not appears when we create activity service. It shows :
    Please specify a valid account assignment
    Message no. SE181
    Diagnosis
    You have entered an account assignment category in the document item for which an account assignment is mandatory.
    All account assignment lines in the service specifications either have been deleted or are inactive (e.g. account assignment lines of a contingency item).
    Procedure
    Please enter an account assignment for the services or value limits.
    The entry of an account assignment is unnecessary if you choose "unknown account assignment" in the document item.

  • How can I replace the Special Character        '

    Hi Guru ,
    I want replace one Special Chareacter into space .
    Example -
    There have one variable .
    L_VAR = BANGA'LORE
    I want to delete the special character ( ' ) which is between A and L .
    Whenever I am tryiny to use replcae statement , it will show one Error Message .
    REPLACE ''' IN L_VAR WITH ' '.
    IT WILL GIVE ONE ERROR MESSAGE - " Literals that take up more than one line are not permitted."
    How Can I replace this .

    Hi Tarak Dey,
    This error
    Literals that take up more than one line are not permitted
    is not for the Replace statement. You would have missed a PERIOD in some statement before this.
    When we see the code that you have pasted,
    L_VAR = BANGA'LORE
    here period is missing at the end of the line. The error could be because of that.
    Kindly check.
    Best Regards,
    Ram.

Maybe you are looking for

  • 1.1 - vista - photos don't display

    I upgraded to V1.1 on my Dell Inspiron 9400 and the photos no longer display. I read a couple of other posts that suggested remomving/changing/upgrading video drivers. I've done this, plus removal and reinstall of Lightroom, plus brand new catalogs a

  • BPM Alert/email

    Hi all, I have a BPM which sends alerts in RWB.How to convert this/,so that the alert message or the payload can be sent to user email accounts using email adapter.any step by step process is greatly appreciated. thanks, RR

  • Stuck with a phone i cant use :(

    I have just upgraded to an Iphone4s via Orange UK and have passed my 3GS down to my good lady but it won't accept her sim as she is on Tmobile uk. How can I get the phone to accept her sim as I dont want the 3gs going to waste..... Thanx in Advance  

  • Package creation overwrites version number while submitting to WP store

    I'm creating a package for submission the first time and I have set the version to 1.1.0.0, but when the package is uploaded to the associated app in Dev center, the package version is showing as "2015.203.1452.4045" instead of "1.1.0.0". I really do

  • How i delete my iCloud account?

    I was struggling to find the way to delete my icloud account. help!