Form validation with button Adobe print

Hi all

I have a form adobe with validation in the field (javascript) already in place, but I try to add one of the additional options for validation.

Let me explain my initial validation first: I have 18 fields with their ToolTip names with a ' *' at the end.  All fields not filled in with this marker of the ToolTip will appear in an alert message when the "print" button is selected.

There are two fields called IException and amount required, but an end user can have additional IExceptions and the corresponding amounts.  That's why I created 5 areas of text for each, but only the first IException and amount are absolutely necessary (and I use a ' *' in their ToolTip).  Now if an end-user has an extra IExceptions ("IException2") and filled with this area, I need to make it compulsory "Amount2" must also be filled.

Here is my code: [code]

function validateFields()
{
var = 0 flg
var n = this.numFields
fArr var = new Array();


for (var i = 0; i < n; i ++)
{
var fn = this.getNthFieldName (i);
var f = this.getField (fn);
TT = f.userName var


If (tt.indexOf('*')! =-1 & & f.value == f.defaultValue)
{
FLG ++;
fArr [fArr.length] = tt;
}
}
if(FLG>0)
{
App.Alert ("there are '+ flg + areas that require a value\n\n' + fArr, 3")
var IException2 = document.getElementById('IException2').value;
var Amount2 = document.getElementById('Amount2').value;
If ((IException2.length >0) & & (Amount2.length == 0))
{
App.Alert ("amount is missing")
}
on the other
{
document. ExceptionForm1.print ();
}
}
}

validateFields();

[/ code]

Currently when one of the fields is NOT filled in, I get my first alert message.  If all the required fields are filled my "print" key don't work.  Also if all required fields are filled and IException2 is also filled but Amount2 is not, I do not receive my second warning message.  So my code works up to 'Var IException2 = document... "and I don't know what is the issue.

Thanks in advance for your help.

a and b should be the value of the fields, not only the fields themselves.

So you can use it either:

var a = this.getField('IException2').value;

var b = this.getField('Amount2').value;

Or this:

If ((a.value.length >0) & (b.value.length == 0))

Tags: Acrobat

Similar Questions

  • Validation problem Spry with button "submit"

    Hello

    I'm new to Spry but I encounter a problem, do work at all.  I created a very simple form (table with text Spry field and submit button).  I have read many articles and visited several forums, but I can't seem to find the problem I encounter.  Basically, when I go to preview the page in a browser, the table with the field button and submit the spy text just fine, but when I hit the button send, I see the page refresh and the values that I had in the text box disappear, but nothing ever comes by saying "a value is required. which is what I'm looking for. This happens even if I have not all values in the text field.  Here are the images of what I describe and also the code.  I checked the 'Required' box is checked in the SpryTextField and the action of the submit button is selected for "Submit form."  My setup is Windows 7, DW6 & XAMPP.  You can provide any help would be greatly appreciated.

    Before pressing the button submit:

    Browser_before_submit.JPG

    Browser after pressing the button: (same as above but no message, 'a value is required.')

    Browser_after_submit.JPG

    Code:

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Untitled Document < /title >

    < script src = "SpryAssets/SpryValidationTextField.js" type = "text/javascript" > < / script > "

    < link href = "SpryAssets/SpryValidationTextField.css" rel = "stylesheet" type = "text/css" / > "

    < / head >

    < body >

    test

    < table width = "600" border = "1" >

    < b >

    < td > < form id = "form1" name = "form1" method = "post" action = "" >

    < span id = "sprytextfield1" >

    < label for = 'test' > < / label >

    < input type = "text" name = 'test' id = 'test' / >

    < span class = "textfieldRequiredMsg" > a value is required. </span > < span class = "textfieldInvalidFormatMsg" > Invalid format. </span > < / span >

    < / form > < table >

    < /tr >

    < b >

    < td > < table >

    < /tr >

    < b >

    < td > < table >

    < /tr >

    < b >

    < td > < table >

    < /tr >

    < b >

    < td > < form id = "form2" name = "form2" method = "post" action = "" >

    < input type = "submit" name = "submit" id = "submit" value = "Submit" / >

    < / form > < table >

    < /tr >

    < b >

    < td > < table >

    < /tr >

    < /table >

    < script type = "text/javascript" >

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "email");

    < /script >

    < / body >

    < / html >

    Do yourself a big favor and don't waste time with Spry Validation.  Most modern browsers support HTML5 forms with the required attribute.

    If you need calm older browsers, use jQuery script validate.  It is lightweight and works when the HTML5 support is missing.  You can see an example below. If you press on submit with empty form fields, required fields in pop - up with messages.  View source in the browser to see the code.

    HTML5 form with jQuery Validation

    Nancy O.

  • Coldfusion form validation using with image onclick = "window.document.forms [0] .submit ();" »

    Hello world

    I would use Coldufusion cfform validation submit the form with a picture and onclick = "window.document.forms [0] .submit ();" "When I try the form is sent, but without validation cfform.js.

    When you are not using a < cfinput type = "submit" > it seems to bypass the coldfusion form validation.

    Is it possible to submit a form without using a < cfinput type = 'submit'... > with standard Coldfusion form validation? All return?

    CF 8

    Windows 2003

    IIS 6

    Thanks in advance for any help and sorry for my terrible English

    Jean-Jacques.

    jjdonate wrote:

    Hello world

    I would use Coldufusion cfform validation submit the form with a picture and onclick = "window.document.forms [0] .submit ();" "When I try the form is sent, but without validation cfform.js.

    When you do not use a seems to work around coldfusion form validation.

    Is it possible to submit a form without using a with standard Coldfusion form validation?

    This is the expected behavior. Validation of cfform.js is designed to be triggered by the form's onSubmit event. However, there is something that you could use.

    Include a submit button in the form. Open the cfm page in the browser. Use the button submit to check the validation works as required. Here's a simple example to illustrate.

    Look at the source code. You will see the validation script that ColdFusion automatically generated for the form's onSubmit event. Copy the script in your CFM page and call its function in the onClick event.

    The above example becomes now (with the help of an onClick)

    The Javascript line "if (_CF_checkf (f)) window.document.forms [0] .submit () to" ensure that the form is sent only when validation is successful. "

  • How can I export my book in Adobe PDF format without it abandoned with a message "printing error"?

    I use Adobe InDesign CC 2015 on Windows 7 and a book with several chapters, each chapter being a separate document. Several attempts to export the book to Adobe PDF failed with the following statement:

    "Printing error: Adobe Print Engine failed at the end of your data due to an unknown problem."

    When I run the command 'Package book for print', it shows that there are some fonts and missing images. However, as far as I know, I replaced all the missing fonts and I'm unable to see all missing fonts or images on the computer screen. Person documents in the book export to Adobe PDF with no problems, but the book does not print as a whole, affecting the table of contents and the page numbering (e.g. Roman in the front-end vs Hindu-Arabic in the rest of the book). I'm frustrated because InDesign doesn't tell me what the problem is. I'd appreciate any help in this regard.

    No, I wasn't trying to PRINT to PDF. I tried to export the book in PDF format in following file > export... and then click on PDF for output. That did not work. However, I just realized that I can export the book by clicking on the small arrow in the upper right corner of the menu that shows all the documents in my book (I don't know how it's called). From there on, I chose "export book to PDF...". "and voila! It worked.

  • I can't connect to the CC with my Adobe ID; the necessary e-mail validation

    Hello

    I can't connect with my adobe id to the CC but I a! And some time ago I was able to connect

    Now I need the apps on another PC and there comes the error "email address must be validated. Click here for a verification email.

    Well, I clicked on this link about 1000000 times and there's no e-mail validation, and I am not able to connect in CC (but in my Adobe account)

    Please contact Adobe customer service

    http://helpx.Adobe.com/contact.html

  • Spry form validation Date with default value error

    The spry form validation below was created with DW CS6

    I created an HTML form and displayed with PHP to a MySQL database.  One of the lines of form is to enter a date.  This line uses a 'out of the box' sprytextfield data validation without changes to its CSS or JS:

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > Date beginning? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" >

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    < script type = "text/javascript" >

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    < /script >

    On request, the form value is captured via PHP and date format is converted to a format of MySQL before entering in the database.

    PHP

    $servComDate = date ("Y-m-d", strtotime($_POST['servComDate']));

    It all works perfectly.

    Now, I created another page with a HTML form to change information.  First, PHP takes the field in the database and converts it to MySQL format to the format used in the sprytextfield above, in which it was created.

    PHP

    $servComDate = strftime ("% m/%d/%Y", strtotime ($row ["servComDate"]));

    Then the HTML form is filled with existing value

    HTML

    < span id = "sprytextfield1" >

    < label for = "servComDate" > if the Service is coming soon, do you know when the service will begin offered? < / label >

    < input type = "text" name = "servComDate" id = "servComDate" value = "<?" PHP echo $servComDate;? > ">"

    < span class = "textfieldRequiredMsg" > a value is required. </span >

    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span >

    </span >

    By filling in the form with existing value appears with the right in the box format, it shows these 'mistakes ':

    value is required. Format invalid.

    As I said above, I have not changed the CSS or JS that is loaded with the Spry textfield, so I don't get that here.

    I'm obviously something wrong with pre-filling a Spry textfield with a default value.

    What is the real need have a default value on a Textfield of Date Validation Spry?

    Thanks in advance!

    Make sure that, in the page change the constructor looks like

    var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "date", {index: "00/00/0000", format: "mm/dd/yyyy"});

    The following works fine for me

    ">

    A value is required. Format invalid.

    GRAMPS

  • PHP form validation and Radio button group

    Hi David,

    I'm trying to set the initial state of a group of radio voice against zero.

    Please look at the file http://ecopethandbags.com/contact.php . The initial state is set to 'No'

    In Dreamweaver, I've set the initial state to 'off '.

    I don't understand the code for radio buttons in my folder (see attachment).

    What I'm trying to do is to have the radio initially disabled but necessary task.

    I have 2 questions:

    (1) - how can I control the initial state of the radio group when I use PHP form validation?

    (2) - how can I set the validation, when one of the radio buttons is not verified by the user, a warning flag like "Please make a selection" appears.

    Thank you very much!

    Just change the following section of code:

    
    

    Remove the! $_POST. Like this:

    
    

    Checked = "checked" will be inserted in the code if the form has been sent, but no radio button has been selected.

  • Can a customer with any Adobe online services sign a PDF form sent by Adobe eSign? (Mobile and desktop options)

    Hello:

    I'm trying a service allowing our small company to sign PDF documents in our offices or on our mobile devices. I came across Adobe eSign Services as a mobile solution (since we already have Acrobat Pro) However, because I am fairly new to the Adobe online services, I wonder is a customer with no Adobe eServices (eSign) could sign a PDF file that has been sent by us with Adobe eSign Manager? (especially on mobile devices. For example, if they had CudaSign or DocuSign) we do not want to cause inconvenience to our customers with download a particular application, or create accounts to anywhere just sign one of our documents. Some clarification in this regard would be appreciated.

    Hello TrinityGal,

    By default, it did not signatories to first have an account E-Sign to esign document. The signatories will receive an email containing the link to document and once it is which is clicked, it is opened in a browser to fill and esign.

    Kind regards

    -Usman

  • Spry form validation

    Given that Adobe no longer supports the Spry framework, what do you recommend that I use to validate a form of box?  Not really that in JavaScript or jQuery.  I use DW CC.

    If you use HTML5 forms, add the necessary attribute to your required fields.  It is pretty well supported by most modern browsers, but there is a variability of x-browser in how works.

    jQuery validation is a good method of form validation client-side little but it is dependent on browser and like Spry was, easily beaten by disabling JavaScript.

    The best and most reliable to validate forms is with code (PHP) server in your form-to-email processing script-side.

    Nancy O.

  • I have confusion about form validation

    Dear all,

    I want to know that, when I use commit_form then form validation, but it happened when no matter what error message come?

    In my programe much written procedure they are trying to insert the record in another table. When an error occurs then insert statement commit. I think that when an error occur then any programe rollback automatically, but my form is not the same.

    Please help me. I'm confused why data are commit.


    AS of Oracle 10g.
    Database 10g.

    Hello.

    Hamid I have to disagree with you on the solution you are proposing is subject to errors of 100%. The chances of reproduction are kept to a minimum, but certain situations could occur again. For example:
    1. the user pressed the button - transaction user 1 starts
    2. the two user press the button a few milliseconds after user 1 - transaction user 2 starts
    3. the operation of user 1 is not yet committed as the operation of user 2 is in the process of verification of the existence of record - result "does not exist because the operation of user 1 is not yet committed.
    4. now, user 1 is committed
    5. the operation of user 2 receives also commited

    So to summarize more of the transaction most likely are the same thing will happen. Correct me if I'm wrong.

    To extend a little further I would say that reorganize you permission one or several tables, so there's a single authorisation identifier that is also defined as a unique key in the database. In this way the database, it's self is guaranteed no two inserts with the same unique key values could be inserted. That way there is no chance the second user would have managed to insert some values.

    Best regards.

    Published by: gregor13 on March 20, 2013 11:52

    Published by: gregor13 on March 20, 2013 14:01

  • Form AutoSave with domain name

    * Forms crosspost, this looks like a more appropriate place for it

    can someone tell me how to a form (perhaps with a button?) where part of the file name is removed from a field in the form of AutoSave?

    Thank you!

    If you want C, write a plug-in - once you did, you'll know why

    Adobe uses JavaScript for scripting in Acrobat

    Take a look at the documentation to learn more about security and privileges: go

    TO

    http://livedocs.Adobe.com/acrobat_sdk/11/Acrobat11_HTMLHelp/JS_API_AcroJSPreface.88.1.html-

    Click then on the

    icon in the upper left navigation bar. See the section on

    privileged content.

    Karl Heinz Kremer

  • Buy a PC preloaded on ebay, which comes with the Adobe software.

    I know that this issue was addressed briefly in other discussions, but I would like a clearer response. Is it legal to buy a computer on eBay which is preloaded with Adobe programs? I am aware of licensing and piracy. I was looking at Mac on ebay these last time and saw a few vendors selling preoloaded suites CS6 on used computers. I know there was a lot of fakes and copies on eBay, and I realize that the "too good to be true" rule is still standing. Adobe, but follow its products when they are on computers? Some of these vendors have sold a number of these computers to buyers with preloaded Adobe products and I don't think that the buyers or sellers are aware of these things.

    I'm already an adobe customer happy with my own CS4 programs, which I paid for through adobe, so I have no intension to buy one like that, especially if it is illegal. I'm just curious to know these things, especially if one day I tried to sell my Mac with adobe products. I heard on the forms of transfer of license, but don't know if it's worth just to program real or not disks.

    Adobe, but follow its products when they are on computers?

    Adobe followed serial numbers and activations produced by serial number.

    Adobe knows no valid - and valid serial numbers.

    People can blissfully use these computers and even the software Adobe on them, not knowing that she is hacked (using invalid or stolen serial numbers). The problems start when they're trying to reinstall or upgrade their Adobe software and know that the serial number is not valid.

  • Strange behavior of validation with the fields 'user entered - required '.

    I have a situation where I have a form with several 'user entered - required"text fields  Some required fields are pre-populated by a server process before being presented to a user in the workspace.  When the user fills the remaining fields and submits the form (by clicking the button "Done" in the workspace), the of standard validation 'required' message, even if all required fields contain data.

    The shape where I discovered this problem is moderately complex, so I built a form simple and process to try to understand what is happening.  The simple form contains exactly two text fields, both are user entered - required.  A field is filled by a server process when the task of the associated workspace is called, B field must be filled in by the user.  There is no script customized beyond the bridge of form and a Submit button.  It's about as simple as it gets.

    If the field is filled, and then the user fills B field and click on 'Finish', the message appears saying 'at least one required field is empty... "even if the two fields contain data.

    If I return to the form and remove the B field (and redeploy the form and remember the process), to field is pre-filled and the user clicks on 'Finish', no message is displayed and the form is sent.

    As far as I know, the built-in for required fields validation works correctly only if all fields are pre-filled or none of them are pre-filled.

    Can someone explain what is happening?

    EDIT: I forgot to mention, I also created and configured an extract of the data for the simple form.  The data preview only contains a value for the to field.  When displayed in the preview of the Designer tab, everything works as expected.

    After a little work I have a better understanding of what is happening and a solution.  I have scripted several calls to xfa.host.messageBox (...) on different events.  It turns out that the pre-filled fields are not the culprit - they have values as expected.  The problem is with the non-pre-filled fields, and and a subtle behavior of the event model that causes a problem when using the workspace INTERFACE (at least on SS3).  Field values may not be resolved until a field loses focus (for example when a user moves to another field, or click a button).  Form used outside of the workspace, by clicking a "submit" button causes the focus to move to the button, which causes the values to be bound to the fields.

    Solution: Use an indirect Submit on the form button and submit indirect click handler used (in addition to your normal code):

    xfa.host.setFocus(null);
    xfa.resolveNode("[[fully qualified name of the real submit button]]").execEvent("click");
    

    Working space should detect and then make an Indirect button and run the associated click Manager, claiming in turn the form submit true button.

    This is where begins the next bit of fun: there is a bug in the form bridge (at least in the ES3 version) code prevents him from indirect detection submit buttons when you use JavaScript as a language Manager click of the button and

    Here is my hack to solve this issue:

    1. Open the 'ContainerFoundation_JS' script in the Script of Designer Editor
    2. Ignore the warning at the top of the file
    3. Find the named function: isIndirectSubmitEvent (it's on the line 1512 or something)
    4. Change the line that reads:
      • if (script.indexOf(button.name + ".execEvent") != -1) {
        

        TO:

        if (script.indexOf(button.name + ".execEvent") != -1 || script.indexOf(button.name + "\").execEvent") != -1) {
        
    5. Save and deploy the form

    If there is a better way to achieve this, please share.

  • Reminder of form Validation?

    I use a cfform and tags cfinput for form validation, and I wonder if it is possible to use jQuery to take action based on the results of the validation.

    Specifically, I want to disable the submit button when it is selected so that the user doesn't click on it more than once, but if there are errors on the form, I would like to re - activate the submit button.

    Is it possible to do using the built in validation of the CF8 form or what I need to use something like jquery validation plugin to achieve this?

    I know that I can use either jquery or coldfusion for the validation of the form, but I was trying to understand, what if I use coldfusion for form validation client side, these coldfusion functions return a value that I can acres that indicates if the validation of coldfusion you found errors?

    If you are uncomfortable with JQuery, I even recommend you not try to use the validation client-side form CF.  It is expected a little for people who are not comfortable with writing scripts on the side of client, but still need [something] on the client side.

    validation validation is client side, that is an SQL INSERT statement: designed for those who cannot do it themselves.  As such they are very simplistic and too pretty 'blackbox' because they are not intended to be part of a comprehensive solution.

    To avoid if one peut DIY.

    --

    Adam

  • Masking of buttons during printing and setting of field to compensate for

    Hello

    I had a request for a form in which add a line button and the button Delete row are hidden when printing to make it a bit prettier.  I was able to hide the buttons for printing, but the table that belongs to delete still looks weird and there is more space I would like to have between the tables once the box add a line does not appear.  Is there a way to make things prettier?  I have attached the demo of the shape, that I'm working on a sample of what it looks like right now when I print.

    I saw a post on the borders of text field masking during printing and it seemed that I might need to do something similar, but I'm not sure what.

    Thank you!

    Image: https://acrobat.com/#d=HvU8V27oA * Ki6HzoI2Ec0w

    Shape: https://acrobat.com/#d=1K * EfksEnAH0azzxTrx31w

    The color of the cell to white should work, because you are repeating an instance of the row that the white background must reproduce as well.

    You can also script with: fieldName.border.fill.color.value = "255,255,255";

Maybe you are looking for