PDF form check boxes under condition

Hello.

I'm building a pdf form in Acrobat 8 Professional. I want to add JavaScript to 3 checkboxes to achieve the following objectives:

If the box 1 or 2 is checked, uncheck the box 3; and if the 3 box is checked, uncheck the 1 and 2.

It seems simple, but I have not been able to find a solution in the Acrobat guide or online. I have no other than copy and paste Javascript experience, so I'm not sure I use the right language to research. If anyone can provide guidance, I would be very happy.

Thank you very much!

You can create a function in a JavaScript script at the level of the document and call it in the mouse event to the top of each box, something like:

// Document-level function
function cbControl() {

    // Get a reference to each check box
    var f1 = getField("cb1");
    var f2 = getField("cb2");
    var f3 = getField("cb3");

    // Uncheck cb3 if cb1 or cb2 was selected/deselected
    if (event.target === f1 || event.target === f2) {
        f3.value = "Off";
        return;
    }

    // Uncheck cb1 and cb2 if cb3 was selected/deselected
    if (event.target === f3) {
        f1.value = "Off";
        f2.value = "Off";
    }
}

Replace "cb1", "cb2", "cb3" the names of the checkboxes that you use.

Here is the code for the mouse upward in the event of each check box:

cbControl();

Tags: Acrobat

Similar Questions

  • I have a pdf form that has 4 columns, with each column having 28 check boxes and text between. I did so he goes by column, but when I do anything for a checkbox it takes it out of line. How can I keep that from happening?

    I have a pdf form that has 4 columns, with each column having 28 check boxes and text between. I did so he goes by column, but when I do anything for a checkbox it takes it out of line. How can I keep that from happening?

    You talk about the tab order? If Yes, go to Edit - Preferences - forms and make sure the box "Automatically adjust tab order when changing fields" is NOT checked.

  • I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes.

    I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes, which is a field required number on there.

    All of them are select___

    Here are all the names of FQDN (towards the bottom):

    Check the boxes:

    • selectiPhone
    • selectSwipe
    • selectMonitor
    • selectDesktop
    • selectLaptop
    • selectiPadCell
    • selectiPad
    • selectPhone

    Fields of costs:

    • CostiPhone
    • CostSwipe
    • CostMonitor
    • CostDesktop
    • CostLaptop
    • CostiPadCell
    • CostiPad
    • CostPhone

    The notes field that will calculate this is "NotesComputer Monitor in notes". -It is a body of numbers forced the inability to put anything else in it.

    Then add them all in TOTAL COST

    Sorry for my ignorance: it's my first time doing a form like this.

    Please see below for the screenshot.

    2015-10-12_1411.png

    Dropbox - conditionalSum.pdf has the answer

  • Hi, I have a PDF form that has multiple check boxes. Some boxes have values (off, yes) that others have just (Yes). How can I get the value of "Off" to all of the other boxes as well. Any help is greatly appreciated.

    Hi, I have a PDF form that has multiple check boxes. Some boxes have values (off, yes) that others have just (Yes). How can I get the 'Off' the value assigned to all the other boxes as well. Any help is greatly appreciated.

    'Off' is the default value of any box when it is not checked. It can not

    be changed.

  • How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    How to use JavaScript to limit the number of boxes to check the user can select a PDF form?

    Here's the working solution

    Please rename all the boxes like chkBox0, chkBox1... .chkBox30 (must start with 0)

    Value of exports of each checkbox must be "Yes" (default value is Yes)

    Place this Code at the level of the Javascript Document

    -Code JavaScript document-

    var counter = 0;                Checked the meter

    -Count boxes checked again when the document is closed and reopened.

    for (var i = 0; i)<= 30;="">

    If (getField("chkBox"_+_i).value == 'Yes') {}

    Counter += 1;

    }

    }

    -The function of validation-

    function validateCheckBox(name,value) {}

    If (value == 'Yes' & meter)<>

    Counter += 1;

    } else if (value == 'Off') {}

    counter = 1;

    } else {}

    getField ("name") .value = "Off";

    App.Alert ("you can select only four checkboxes");

    }

    }

    -End of Document Javascript-

    Now put this line in the MouseUp event all checkboxes

    Box - Code MouseUp event.

    validateCheckBox (event.target.name, event.target.value);

    //----------------------------------------------------------------------------------

    Hope this will help

    Kind regards

    Post edited by: Mohammad Irfan

  • How to check boxes or "bullet holes" on a PDF fillable?

    How to check boxes or "bullet holes" on a PDF fillable? I use Acrobat Pro DC and have not been able to find anything online, only the ends for older acrobats.

    Acrobat help. Create and distribute PDF forms

  • Change the color of a check box for a static PDF checkbox control

    Hello

    I don't know if it's possible, but I can't change the color of the box of a checkbox in a static PDF.  It works fine if the PDF file is dynamic, but it craps on when the PDF file is static.

    Is there a solution?  I don't have to change dynamically based on the interaction of the user, the client wants to just a blue tick in a static PDF.  Anyone with the same problem?

    VNAME var = this.somExpression;

    var fieldObj = xfa.resolveNode (VNAME + ".ui. #checkButton");

    set a variable to deal with the color of the tick

    var myTick = event.target.getField (this.somExpression);

    myTick.textColor = color.blue;

    fieldObj.mark = "check";

    It works when rendered to PDF dynamic, but myTick is always null when it is rendered in the static PDF form

    See you soon,.

    Nelson

    You can change this by editing the XML source.

    Add the part to the source of the checkbox.

               

                  

                     

                  

               

    It should then look something like:

               

                  

                     

                        

                        

                     

                  

               

               

                  

                     

                  

               

               

               

               

                   0

               

               

                  

                  

                  

                      Checkbox

                  

               

               

                   1

                   0

                   2

               

            


  • What happened to the PDF check box in the Menu Overview print?

    On my Win 7 Pro computer, v41.0.2 Firefox has a checkbox adjacent to the button PDF PRINT, which changes to SAVE the PDF file when the check box is selected. This GREAT feature is missing from the Firefox v41.0.2 on computer WIN - 8.1 from my wife. How is it?

    Print Edit = > you got it on the two Firefoxes?

  • Hi, PDF form of the guru. How to make a text box become a required field IF a drop-down list is selected as the "Yes"?

    Hi, PDF form of the guru.

    How to make a text box becomes a "required field", IF a drop-down list is selected as the "Yes"?

    and 'not required' if the drop down menu selected as 'No' or left blank.

    Any help would be greatly appreciated

    see you soon

    Use this code in the custom drop-down list field validation script:

    this.getField("Text1").required = (event.value == "Yes");

    (Change "Text1" to the actual name of your text field, of course)

  • How can I send a document by e-mail in PDF with editable fields, drop-down boxes and check boxes?

    Our company uses Adobe Reader as well as the version where send you it for signature, convert to word, excel etc.

    What we are trying to do, however, is create the PDF document, save it to our readers of local network for use in a format PDF with editable fields, drop-down boxes to select and check boxes.

    Can you help me please?

    See you soon

    Lucinda

    Hi lucindab50782713,

    Yes, you can save the document as a model using eSign service create a library template | services eSign so that it can be reused.

    Kind regards
    Nicos

  • Account service check box in the form of the object in OIM 11 g 2

    Hello

    I have attached a form of the (linked to a resource object) object to the instance of my application. By default, Service check box account get appears in the form of the object when I click on the account on the page the user Details in the detailed information section.

    Even if it is currently disabled and not to impede the procurement process, is there a way to delete this box or hide the user?

    You will really appreciate a quick response.

    Thank you and best regards,

    Jenifer P

    Hello

    Can you please go through this link

    Section - 30.4.9 showing and hiding of attributes

    http://docs.Oracle.com/CD/E27559_01/dev.1112/e27150/uicust.htm

    The steps described above in the link can be applied to your item form to hide the field service account

  • Check the spelling of the names of bookmark in a PDF form

    Please let me know if there is a way to check the spelling of bookmarks in a PDF form.

    Thanks for the help!

    Ken k. - 2191

    There is no built-in way to do it, but it can be done using a script.

  • Created a form of contact, but when the customer has received potential customer demand, check boxes change to a true or false, there a way to change Yes or no?

    Created a form of contact, but when the customer has received potential customer demand, check boxes change to a true or false, there a way to change Yes or no?

    This is the system default, you can customize either she or you try using forms of third party:

    http://musewidgets.com/collections/all/products/forms-bundle

    Thank you

    Sanjit

  • How can I use a check box to insert another form acrobat on itself?

    I created a form in acrobat for our domain service department which includes a security inspection form. If a customer will not allow to carry out the inspection a NO check box is enabled and they would like to than the inspection sheet to disappear from the screen. Well they want security report card or introduced in the form of field service when the YES check box is selected. Any thoughts on whether either of these actions are still possible?

    It is possible with the latest versions of Reader on Windows and Mac. What kind of devices people service department use?

  • Prevent printing of PDF forms and masking of the useless message boxes.

    I have a PDF form and I need to avoid printing this PDF form, if the fields are empty.

    To change my form, I use Adobe LiveCycle Designer ES3.

    On how can this be done is written here: http://Forms.stefcameron.com/2008/04/13/prevent-printing-PDF-forms-in-Acrobat-8/

    The only thing that I need more than this article - is to remove the cancelled 'Impression' message box.

    So, if anyone knows how, please help me.

    Hello

    the XFA specification does not describe not a way to remove the error message for the item to validate, so it seems to be impossible.

    http://partners.Adobe.com/public/developer/en/XML/xfa_spec_3_3.PDF#page=1340

Maybe you are looking for