Help: Field accepting does not leading and ending zeros

OK I am struggling with this script for a while, and whenever I think its fixed I find a new problem, sorry I keep bothering you with this guy! I hope that this

will be the last problem however! I am trying to validate a field when submit button that checks to ensure that this field has the correct format, which is "XXXX. XX. " So far the best term for this was /^\d\d\d\d\.\d\d$/

({I also tried / ^ \d{0,4}(\.\d{0,2})? $/ but that they gave me a lot of problems, the main being that it only accepts this field to have 4444.22, another thing, for example, 1234.56, generates an error.

So now when I use /^\d\d\d\d\.\d\d$/ everything works fine as long as the field do not begin or end in zeros. So either 0123.45 or 1234.50 generates an error, but the 1002.34 supports very well. I need something to add in the script, either a different expression, or something that will allow the head or ending zeros. I do not want to add zeros though, if the user enters 1234.5 I need to generate the error message, I don't no need to change for 1234.50.

Thank you in advance for your help!

OK, my initial thought was that you were using the regular expression in a script field, but it is used on an earned value field.  So I did some tests and Acrobat automatically converts the value to a number.  A little unexpected, but there is an easy solution.  Change your code like this:

var re = / ^ \d{4}\.\d{2}$/;

var num = getField("text1").valueAsString;

bOK = re.test (num);

A lot of pain for a little fix, business a habit for software development ;)

Thom Parker
The source for PDF Scripting Info
pdfscripting.com

The Acrobat JavaScript Reference, use it early and often
http://www.Adobe.com/devnet/Acrobat/JavaScript.html

Then more important JavaScript development tool in Acrobat
The Console window (video tutorial)
The Console Window (article)

Tags: Acrobat

Similar Questions

  • My CC desktop application does not open and shows a spinning wheel of progress without end. It also doesn't show Menu: home, applications, files, fonts, community.

    My CC desktop application does not open and shows a spinning wheel of progress without end. It also doesn't show Menu: home, applications, files, fonts, community.

    I use Windows 7. I tried several times the instructions here: App does not open. Wheel of progress turn continuously

    I am able to ping adobe.com and three other Adobe servers I found on a site help, but can't find them now.

    I can't do a ping activate.adobe.com

    Hi Michael,

    You can see the threads below where this issue has been addressed:

    Adobe Creative Cloud / Desktop App / Home Screen: constant spinning wheel

    Creative Cloud Desktop App taped blue spinning wheel after update.

    Kind regards

    Sheena

  • My 5s, IMessage iPhone does not work and when I try to activate it by electronic mail, the box opens, but I hit the sign in button and his stays there as it's frozen! Someone help me please find a solution

    My 5s, IMessage iPhone does not work and when I try to activate it by electronic mail, the box opens, but I hit the sign in button and his stays there as it's frozen! Help

    A deal with this * day. Only thing that worked was plugging it into the computer, it supported up to the computer. Do you have a reset, and when that went to spend he asked me to do an update "carrier". If you're on verizon? My co worker and I have the two are facing it today

  • my windows firewall does not start and I get a erroe code 5, can someone help me

    my windows firewall does not start and I get a erroe code 5, can someone help me

    Hello

    1. What is the brand and model of the computer?

    2. what security software is installed on the computer?

    3. have you made changes on the computer recently?

    Method 1.

    To resolve this problem, click the fix button of this article to diagnose and fix common Windows Firewall problems automatically.

    Some services start not in Windows Vista and Windows 7: http://support.microsoft.com/kb/943996

    Method 2.

    Automatically repair the settings of Windows security to secure your PC: http://support.microsoft.com/mats/Malware_Prevention/

    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: How do I back up and restore the registry in Windows

    For Windows 7: back up the registry: http://windows.microsoft.com/en-US/windows7/Back-up-the-registry

    I hope this helps.

  • I was not able to open my my Adobe Illustrator application after update. He says there are a few problems with the preference but after following the instructions, Illustrator still does not work and it keeps giving the samei question. Help, please.

    I was not able to open my my Adobe Illustrator application after update. He says there are a few problems with the preference but after following the instructions, Illustrator still does not work and it keeps giving the samei question. Help, please.

    I think you are talking after upgrade to CC 2015 you're not able to launch I. Also, I believe you speak for read only matter of preference.

    After following the instructions please do not launch Illustrator and check your file preference if the permissions have been set correctly. A good way would be to get inside the preferences folder and then try to create a file manually. If it succeeds, please write to [email protected]

    A few external links to help you set permissions:

    MAC

    OS X Yosemite: set permissions for items on your Mac

    WIN

    Set, view, change, or remove permissions on files and folders

    r-and-file-permissions/465f2b42-63dd-4486-8dd1-c870290efeed http://Answers.Microsoft.com/en-US/Windows/Forum/windows_vista-Files/How-do-i-change-folde

    Kind regards

    Ashutosh

  • After that I put my password, it indicates that my personal profile does not load and it gives me a temp

    original title: Login - personal profile

    After that I put my password, it says that my personal profile does not load and it gives me a temp.  He told me to go in the event log or contact administrator

    Your computer has recently made an update? There are now three consecutive profile simillar problems in this forum. I checked my update and there are 13 important updates, I invited I have to wait. I hope that someone could come up with the cause. The problem is serious, which can lead to loss of your files.

    Vista - user - logged on with a temporary profile profile error

    http://www.Vistax64.com/tutorials/135858-user-profile-error-logged-temporary-profile.html

    I hope I could help

  • Task Scheduler does not VB and Java tasks

    Task Scheduler with the line of action

    "cmd.exe /K java.exe - version".

    a new window does not open and is not running java.  The exact line is present in the Task Manager, as an instance of cmd.exe command line, but process Explorer 64-bit says that it uses cycles.  Absolutely none of my Java programs that have a window runs the Task Scheduler; run the Java programs in console mode.  It will even if I try to start using the run key in the registry.

    I have three version of Windows 7 installed on this computer - one for each of the three mobos.  As a mobo closes I fixed it and use another installation of Win 7 on a different mobo.  On the previous version of Windows 7 that I used, VB Programs worked well, but one of them will not run on it.  He arrived at the place where it tries to show the first of the two windows and stops.  The other VB program runs until the end, with his window open.  I can't discern any difference between the two programs.  If I run a program from a toolbar or from the command line, all is well.

    Java programs to run OK on this computer, but they just stopped one day.  I think it was an update.

    It must be a security or a question of privilege, but I don't know what it is.

    Hello

    You did changes to the computer before the show?

    I suggest you follow these methods and check.

    Method 1: Perform the clean boot and check.

    To do this, follow the steps in this link:

    http://support.Microsoft.com/kb/929135

    NOTE: After you check the clean boot feature configure Windows to use a Normal startup using step 7 proposed in the above mentioned link.

    Method 2: Run the tool (SFC.exe) System File Checker and check if it helps.

    Follow the shape of measures the following link: http://support.Microsoft.com/kb/929833

    Method 3: Re-create the tasks and check.

    http://Windows.Microsoft.com/en-us/Windows7/schedule-a-task

    I hope this helps!

  • What Messege 'sapp came to the notification bar but wht' sapp does not open and he will be hanged iphone! What should I do?

    What Messege'sapp appears in the notification bar but it does not open and in addition he shall be hanged my iphone6! So, what should I do?

    Try these steps, maybe this will help you:

    1 check WhatsApp update: Open App Store from your iPhone, click on updates, check if the application needs to update.

    2. restart your iPhone: hold down the sleep/wake button to it turn off and then turn it on again.

    3. close the app: multitasking opened by double pressing the Home button, slide the nonresponse apps up to close.

    4. go in the settings, press Whatsapp, touch turn off everything except mobile and notofications data.

    5. return to the home screen and open whatsapp.

    6. go in the settings, press Whatsapp and turn back.

    7. open whatsapp again. It should work now.

  • can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    Are you sure that you do not have to register on this site through the usual way and what you should be used elsewhere on the site?

    Have you tried to contact them to help this topic or to check if they have a FAQ on this subject?

    I found this in another thread that you created [*]:

    I'm not sure do I bought a home income internet james ashley program and I copied the login info I was given and the password does not fit into the window of password and I forgot the link password does not work I sent emails, but do not receive an answer im don't know what to do is anyway you can help me to recover my info or help me change the password?

    I assume that you have downloaded and installed this program and need to use this password in this program or only you can use these data to download the program from the site james ashley?

  • Mac does not start and the fans going crazy

    Computer does not start and the fans work hard and fast. Someone has an idea what is the problem and how can I solve this problem?

    OLA I will try help EU tenho um macbook pro, mas esse problema não me it happened ainda EU acho seria o seu mac origem help esse problema pode formatar better.

    SE nao tem'm ligar o seu osx para formatar use cmd + r e ligar pressionar cmd + r ele deve AI PODES ligar restore o seu novo osx.

  • Satellite Pro L300-21F does not start and the screen remains blank

    L300-21F is aged 18 months, so out of warranty. When you press the power button, you can hear the fan and a "click" but the hard drive does not start and the screen remains blank. The power and the battery on the headlight LEDs, but the switch light does not work. I checked the power supply and it is 19.3V and substituted a good known. Removed the battery, tried with just the power cord and still nothing. Pressing ESC or F2 when you press the button power does not bring to the top of the screen of the bios or any other message. I have concluded there is no power the jury. A friend he had its technology take a look and he concluded Council is probably a friend.

    So my questions are:
    1. He's probably right?
    2. is it a common problem with an easy solution?
    3. what else can do before shelling out for a new Board of Directors?
    4. is there a link where I can find how to disassemble the case?

    Any help appreciated

    Hello

    > 1. He's probably right?

    Yes, it looks like motherboard failure

    > 2. Is this a common problem with an easy solution?

    If it's a motherboard problem, the whole motherboard is replaced. Quite expensive part...

    > 3. What else can do before shelling out for a new Board of Directors?

    I don't think you can do anything with fried mobo

    > 4. Is there a link where I can find how to disassemble the case?

    Take a look at the site called irisvista.com

  • Touchpad does not work and Equium automatically restarts after a stop

    Something going wrong drasticaly yesterday. I wasn't doing anything elaborate, just work excel and I'm tired of the Tablet touch and 'connected' one infrared I smile sometimes use... it did not work too well, low battery level, I guess, so I returned to the touch pad... but the touchpad was now for some reason, doesn't work do not at all and did not since...

    Turning off the laptop and was my solution, but he has not corrected the situation... the infra-red mouse works very well but with new batteries... on top of that, now when I turn the laptop off, it stops but then automatically starts once again, when a microsoft message appears saying that the computer has recovered from a serious error.

    So since this episode, the touch pad does not work and the computer will stay off! And maybe it's me crazy, but some of the keys on the keyboard are more sensitive as they once were.

    It was a satellite, and bought only in early January.

    If anyone can help I would appreciate it a lot.

    Thank you

    Hello

    Sound very mysteriously. However, as in the first answer mentioned the function FN + F9 turn off and turn on the touchpad.
    I also recommend to check the Device Manager if all devices are working properly.
    If you find any errors, but the problem persists then the step of text should be the reinstallation of the operating system. In this case, please use the recovery CD.

    If the recovery procedure will not solve the problem, I guess there must be something wrong with the hardware and the ASP help is needed. Guys could start diagnostic tests and can locate the fault.

  • When I try to print a PDF file it does not print and goes directly to a backup of the file option.

    When I try to print a PDF file it does not print and goes directly to a backup of the file option

    original title: pdf print
    Hello

    1. don't you make changes on the computer before the show?
    2. don't get any error message?
    3. what version of the operating system is installed on the computer?
    4 is the issue limited exclusively with printing PDF files?
    5. where are you printing from PDF files?
    6. What is the brand and model of the printer?


    Method 1:
    Run the fix it and check.
    Diagnose and automatically fix problems printing and printer
    http://support.Microsoft.com/mats/printing_problems/

    Method 2:
    Perform the steps from the link and check.
    Printer in Windows problems
    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

    Method 3:
    You can perform the steps from the link and check if you are able to print.
    Resolve PDF printing problems. Acrobat, Reader

    Reference link:
    Why can I not print?
  • After Vista update cannot find the external hard drive, AutoPlay does not work, and new unusable disk appears under my computer

    After Vista update cannot find the external hard drive, AutoPlay does not work, and new unusable disk appears under my computer. Also I can't 'manage' my computer because I do not have "permissions". I tried a fix he 45071 and it did nothing.

    Applications, (Norton and McAfee) (including free evaluation versions are notorious for not not upgrade (or uninstalling) itself.) If NIS has been installed for 3 years, you have NIS update at least once and maybe twice (e.g., NIS 2009 > NIS 2010 > NIS 2011).

    [You may want to print these instructions for reference offline. If a step said to reboot, reboot.]

    1. download the Norton Removal Tool, save it to your desktop: ftp://ftp.symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    2. close all open applications (that is, anything with an icon on the taskbar).

    3. After completing some you have a copy of your handy product key, uninstall all Norton software (including LiveUpdate and everything Norton Add ons) viaControl Panel | Programs | Uninstall a program (or Control Panel |) Programs and features, if you are using the classic view).

    4 IMPORTANT! -Online activate Windows Firewall immediately after the restart.

    NB: Now you're "working without a net": no to ANYTHING else online (e.g., navigation, reading e-mail, chat) until you have completed step #7 below!

    5. right click on the file that you saved in step #1 above, and then select run as administrator.  DO TAP not your keyboard until the race ends, then restart.

    6. do a clean install of NIS 2011 (using your product ID, if need be) & reboot. CF. http://www.symantec.com/norton/support/kb/web_view.jsp?wv_type=public_web&docurl=20080514162318EN

    NOTE: Do NOT activate or install additional modules of Norton (for example, Norton Anti-Phishing) immediately.

    7. manually and repeatedly run LiveUpdate (Norton) until you get a prompt "no update more".

    8. open Internet Explorer (only) to http://support.microsoft.com/kb/923737 & run the difficulty.

    9. open Internet Explorer (only) to http://support.microsoft.com/kb/971058 & run that set it by DEFAULT and modes and AGGRESSIVE. [1]

    10. restart once again & test.

    NB: Installation KB971029 disables AutoRun/autoplay on USB connected but not 'brilliant media' external drives (i.e., CDs & DVDs). See http://blogs.technet.com/b/msrc/archive/2011/02/08/deeper-insight-into-the-security-advisory-967940-update.aspx

    ~~~~~~~~~~~~~~~~~~~~~~~~
    [1] full Disclosure: the difficulty operating in AGGRESSIVE mode will remove your update history but not list the updates installed in Add/Remove Programs (Windows XP) or installed updates.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Recently bought studio 15 laptop with windows 7 and I try to run need for speed pc underground game on her, but she does not appear and the message "speed.exe has stopped working" appears on the screen

    Recently bought studio 15 laptop with windows 7 and I try to run need for speed pc underground game on her, but she does not appear and the message "speed.exe has stopped working" appears on the screen. can someone help us?

    Hi Andy,.

    I checked the reported compatibility list, and the game is listed as compatible.  Work in 64-bit or 32-bit Windows 7?  I will try to reinstall the game, if you did an upgrade from Vista to Windows 7 recently.  If it is a new installation and does not, please visit the EA's Web site to get the latest patch for the game to see if that helps address your problem.  Let me know if you've done all that and you still have questions, and we can try something else.

    Kevin

Maybe you are looking for