Script to validate a field when submit button does not

I have a script to validate certain fields and generate an error message if the fields are empty or not filled out correctly. Everything works well except for one of them. I'm trying to generate an error message if one of the fields has an invalid format in it. For example, the format must be "XXXX. XX "(all numbers) so if they enter"XXXX"generates the error message and does not have a shape. I have a setup of the function in this area and it works but unfortunately users ignore the error message and submitting the form when same and this field really need to be right before being transmitted.

That's what I use for this:

var bCancel = false;

var strMsg = "";

{If (getField("Tracking").value == {/ ^ \d{0,4}(\.\d{0,2})?$/})}

bCancel = false; }

If (getField("Tracking").value! = / ^ \d{0,4}(\.\d{0,2})?$/) {}

strMsg = "Invalid Format. Please correct before proceeding. (EX: 0000.00) « ;

bCancel = true; }

So the problem is it generates the error message now even if the format is correct. I do not know I did something wrong, but I wrote the format in the same way (/ ^ \d{0,4}(\.\d{0,2})?$/) when I ran a script to format custom in this area and it worked fine, so I don't know what I'm doing wrong. I am also including this part of the script with the rest of the field controls in the submit button. So altogether it looks like this (just with a lot more fields, does not include all the bc it gets quite redundant)

var bCancel = false;

var strMsg = "";

{If (getField("Tracking").value == {/ ^ \d{0,4}(\.\d{0,2})?$/})}

bCancel = false; }

If (getField("Employee_Name").value > = 1) {}

bCancel = false; }

If (getField("AcctNbr1").value > = 1) {}

bCancel = false; }

If (getField("Tracking").value! = / ^ \d{0,4}(\.\d{0,2})?$/) {}

strMsg = "follow-up field format is invalid. Please correct before proceeding. (EX: 0000.00) « ;

bCancel = true; }

If (getField("Employee_Name").value == "") {}

strMsg = "at least one required field is empty for export. Please fill the required fields (in bold) before continuing. « ;

bCancel = true; }

If (getField("AcctNbr1").value == "") {}

strMsg = "at least one required field is empty for export. Please fill the required fields (in bold) before continuing. « ;

bCancel = true; }

If {(bCancel)

App.Alert (strMsg);

} else {}

this.mailDoc({)

bUI: true.

cTo: " ""[email protected]", ".

({bassujetti: ' form returned: interview form "});

}

I'm fairly new script, especially in Adobe, so I probably did a great job with this. Please let me know if there is anything I should change to make it work better. Thank you in advance for your help!

Yes, it's really hard to tell what is happening without seeing the file. You can post here, but if you can't post elsewhere (e.g., acrobat.com), feel free to send me by e-mail (see my profile) and I'll take a look.

Tags: Acrobat

Similar Questions

  • Signature field and submit button does not

    I've recently upgraded to LiveCycle Designer ES2 and problems with certain features.  I created a form with 3 fields of signature and a send button for the final signatory to email on the back of the form.  None of the signature fields works; or not the submit button.  I did everything the same as I had in the previous version of the software.  However, it seems that there are a few changes that I know.  I read about locking objects, but got a little confused.  Can someone tell me (in very lay terms) what I need to do to get these functions work?

    I don't see a screenshot. If you have tried to contact by e-mail, that it won't work, you need to use the interface of the forum.

    In any case, to enable a document depends on which version of Acrobat you are using:

    Acrobat 8: Advanced > enable usage rights in Adobe Reader

    Acrobat 9: Advanced > extend features in Adobe Reader

    Acrobat 10: File > save as > Reader Extended PDF > activate additional features

    Acrobat 11: File > save as other > Reader Extended PDF > activate tools plus (includes filling form & save)

  • Submit button does not work after upgrade

    I've recently updated to Acrobat X Pro and Office 2010.  I'll set up a simple form with a "SUBMIT" button below to send the PDF filled to e-mail the company.  I did this successfully in the past with 9 Pro Extended and Office 2007.  However, now when the button is clicked and the screen asking if I have a desktop or web email client returns, I answer desk, and nothing happens.

    Is this a known problem or I do something wrong?

    Thanks for your help!


    Donna

    I steal you response that George gave to a similar question, because it turns out that it applies here as well:

    ************

    George Johnson February 23, 2012 11:17

    When you distribute a form, it replaces the e-mail address that you have configured in a submit button with the address that you specified in "Edit > Preferences > identity > E-mail address. So before of you start the process to distribute the form, change the email address it to that you want to use.

    ******************

    This is a ridiculous solution, because this means that I have to do the identity of my personal copy of Acrobat email address of someone else or some other service when I do the form, but whether - at least the form now sends.

  • Using signature field, after save, submit button does not work

    Hello

    I'm experimenting with the digital ID for signing. I have the sign on the memory works fine. I'm now experimenting with the Signature field. When the user finishes the signature and saves the file, the buttons are no longer active.

    Is - will this work as expected? Is there a way to save the file and still submit by e-mail?

    Thank you

    MDawn

    I suspect that you have not created a collection of custom signatures:

    If you configure a new signature collection, you can select objects, such as the button, which is not locked when the signature is affixed.

    Example here: https://acrobat.com/#d=zYfWoMpI5j9CmHa57Ym9hA

    Hope that helps,

    Niall

  • Introduce the button does not

    Hello

    One day I was able to submit form using Adobe webste Muse in my mail and it works well, but now the submit button does not respond. Can I know the reason why it suddenly happen?

    Thank you.

    It should not, another reason that as Javascript is disabled on the page open for the browser.

    Publish the url of the page for inquiry.

    Thank you

    Sanjit

  • Form button submit contact does not display correctly

    When you use Adobe Muse in fashion design all on my contact form looks like a lot, but when I download the site or preview the page in my browser, the submit button is not displayed correctly.

    The police is a bit fuzzy and unclear and effects like opacity on the submit button just display a solid color rather than adding opacity.

    The rest of the form uses the same font and also tried different web fonts without success, so don't know why, it's just the Send button!

    I use the latest version of Muse on a Mac

    Hi Simon,.

    Please see: button "submit" is blurred in preview mode before and after validation

    Kind regards

    Akshay

  • Submit by Email button does not work

    Hope this has answered Don t too many times before. Impossible to find what so wopuld appreciate any help...

    Anyhoo,

    Created a form old plain samiple in Acrobat Live Cycle with the buttons send and print on the top.

    When I send it to someone with Acrobat it works fine, however...

    If they don't have Acrobat and have that player on their PCs, the submit by e-mail button does not (although the impression one did).

    You receive an information box telling you initially it will send data in this way, but once closed, it has no functionality...

    Obviously I'm doing something wrong as usual, but can not understand. Outside, it is saved in static Adobe PDF format...

    Any help please please please...

    You have to drive to extend the form to allow this. Open in Acrobat and under the Advanced menu choose the option "extend features in Adobe Reader. This will start a wizard. Take all the default settings. When finsihed, save the file and distribute that saved the file.

    Paul

  • When I return from the page of google search for a link then button does not return return

    When I return from the page of google search for a link, then button does not return back. Instead, the same page refills. I need to go back click back button twice or even more. How to fix? I cheked it it another browser and there is no such behavior. It seems completele Firefox problem.

    the problem was resolved after remooving extenshion «user agent overrider»

  • When I click on the new tab, new tab button does NOT open.

    When I click on the new tab, new tab button does NOT open.

    Please update your browser Firefox 3.6.24 or 8 and check

  • the stop button does not respond when I needed to stop a program

    I want my labview program to stop when I press the stop button, but this isn't the case... stop button does not work... I have used a loop in which there is event structure n structures case... I have attached my file... so please help me...

    Hello

    In your code, this can be done by using the new event on "Stop" button when press it it will give a true

    Like this

  • How can I click apply when switching back resolution lower when the window does not display the Apply button when

    How can I click apply when lower resolution when the window does not display the button apply because the resolution is too low

    Hello

    Try pressing the ENTER key on the keyboard instead.

    See you soon.

  • When I go to my creative cloud application, it said that I have no internet? try it again the button does not work

    When I go to my creative cloud application, it said that I have no internet? try it again the button does not work

    Log, activation, or connection errors. CS5.5 and later, Acrobat DC

    https://helpx.Adobe.com/x-productkb/policy-pricing/activation-network-issues.html

  • Factory settings Resinstalling when blue Thinkvantage button does not work

    Last year, I panicked when I thought I had a virus. Rather than rely on my own multiple back-up system, I guess someone knew more about computers that I do and let someone else in my computer. My X 60 has not worked properly since. The Thinkvantage button does not work, and it is hit and Miss as to if I can get the thinkvantage functions to work. My wireless radio buttons don't work at all, and the indicator wireless lights turn on and turns off at will.

    I tried to reinstall the application and the update of all implement the Lenovo site, but nothing worked, so I think I'll have to reinstall the orginal factory settings and start over again to clarify these issues.

    I backed up all my data, and made discs (just in case) recovery... now my question is, how do I start to "rescue and recovery" / 'reinstall factory settings' when the blue button does nothing when I push at the start?

    (Works under XP - if that makes a difference).

    Thank you

    Problem solved.

    I managed to get into Rescue and Recovery manually and found that I had a backup on my C drive that existed prior to my problems. I just restore to that date and "presto!" the blue button works again!

    I'll have to spend the rest of the day, re-installing everything that has been added or upgraded from a year, but this simple step seems to have solved my problem. Who would have thought that I had a copy of backup to disk C - I thought I backed everything up to an external drive!

    Tip for any staff of Lenovo, reading this - if your security people knew more about Thinkvantage program, I could have solved this problem months ago - these are them who sent offshore to find updates to day and re - install Thinkvantage to try to get the blue button works again.

    Thank you all.

  • How to open the program when it is opened the button does not appear

    Open the button does not appear on my cloud creative adobe, how to open a program otherwise?

    If you have installed the Adobe Creative Cloud Desktop from here: creative cloud desktop application and you want to start, click the icon of creative cloud located in the taskbar (Windows) or the Apple one piece (Mac OS) menu.

    If you have not already done so, you can use the desktop creative cloud app to install applications.

    Using creative cloud | Download, install, update or uninstall applications

    Here is information on the launch of applications: applications Cloud Creative pitch

  • The "Send form" button does not work in Chrome or Safari PDF viewer

    I have created a PDF file and have included a button 'Submit' at the bottom of the page. When all required fields are completed, hit Submit attached the document in an e-mail message to us. The only problem is that this 'submit' function only works when you view the document in Adobe Reader.

    Given that the form located on our Web site, when the link is clicked it opens upwards by default in Safari or Chrome PDF Viewer for the browser (etc.). Unfortunately, the 'Submit' function does not work in the browser view. The fields are to be filled, but the Send button does not work.

    Suggestions?

    These browsers display PDF files using their own internal PDF plugin. You should report bugs with these plugins to their creators.

    It has nothing to do with Adobe.

Maybe you are looking for