Check the boxes based on the value in a text field

Hello.

I'm building a pdf form in Acrobat Professional X. I want to add JavaScript to two checkboxs to achieve the following objectives:

If the value of a text field (TLigne) is equal to 61, 64, 66 or 67, the first box (PlanACheck) has the value of the object of an audit.  If the value of a text field (TLigne) is equal to 60, 62 or 63, the second box (PlanBCheck) has the value of the object of an audit.

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!

Usually this kind of thing will run the custom calculation of the target field script, but the boxes is not a calculation script, so we'll use the text for field Validation script do, with this code:

this.getField("PlanACheck").checkThisBox (0, (event.value == "61" | event.value == "64" | event.value == '66' | event.value == "67"));

this.getField("PlanBCheck").checkThisBox (0, (event.value == "60" | event.value == "62" | event.value == "63"));

Tags: Acrobat

Similar Questions

  • Referring to the value of a text field, not the legend

    How to refer to the value in a text field to make the data entered by the user "BOLD" / no fat without the caption of a field text in bold or not bold?

    Hello

    Two lines should do. The first turn the caption and the "BOLD" value, then the second changes the legend of back to normal:

    TextField1.font.weight = "bold";
    TextField1.caption.font.weight = "normal";
    

    Hope that helps,

    Niall

    Ensure the dynamics

  • How to make the sum of numeric fields based on a value in a text field - charge memo

    I'm working on a Weekly Report of expenses employee that contains a list of charges and each can be marked as a company or a paid employee costs.  There are two fields in the form which is to show totals for the company and the employee paid expenses.  There are seven columns for amounts, one for each day of the week.  Expense Code text fields are called "Exp1" through "Exp7".  Digital type amount fields are called 'Amount1' by 'Amount7.  The fields under each column share the same name.  (Hope that makes sense).  A screenshot is below, and a link to the form is included in order to better understand the composition of the form.  I don't know how to for a total of to the top of all expenditures that are marked with a 'C' and all those marked with an "E".  I'm not well versed in Java.  Any suggestions would be greatly appreciated!  Thank you!!

    Link to the form:

    https://www.dropbox.com/s/sgsle5bkam2y4am/expense%20Report%20v1_0%20-%20LC%20Original.PDF? DL = 0

    Expenses.jpg

    I tried to implement your requirement in the form at the following link. If please test and let me know if it works.

    https://www.dropbox.com/s/v4n9kypdnplc857/expense%20Report%20v1_0%20-%20LC%20Original_V1.p df? DL = 0

  • Set by default to the value of another text field

    I imported a several page PDF in LiveCycle Designer.  I place a text field on each page of the PDF file.  I want the user can click in the text field on the first page and type its value.  Then I want to fill in any other fields of text on other pages.  How do I put the default value of the other fields to make this work?

    You can bind the fields in the object > tab link. Simply, name them all the same thing and change the global default binding.

  • Get the value of a text field in a dialog box?

    SystemPrompt *prompt = new SystemPrompt();
    //SET ADDITIONAL PROMPT SETTINGS
    
    //LATER IN THE APP
    myTitle = prompt->inputField->?????
    

    How can I get the text that a user has entered my guest?

    I tried:

    myTitle = prompt->inputField()->defaultText();
    

    But no luck.

    It is in C++.

    Thank you

    You can use the function of Member SystemPrompt::inputFieldTextEntry()

    I've only used in QML so far, but I guess in C++, you would use:

    prompt->inputFieldTextEntry()
    
  • JavaScript in a PDF file that checks the value of a specific field and then make the right calculation.

    Hi guys!

    Sorry for my English is not my mother tongue.

    This is my first time writing here, I just discover the great possibilities of Javascript in PDF files and I'm very excited about it!

    I have no experience with Javascript, that's what I would do:

    Basically, I need to calculate how many litres of gas is needed to do a specific job in agriculture.

    I have a table that looks like this:

    Seed: 120 litres/Km

    Weeding: 20 litres/Km

    Fertilize: 140 litres/Km

    I have 3 fields in the pdf file: OPERATION / KM / NECESSARYGASOLINE

    I need something like this:

    Seed = 120;

    Weed = 20;

    Fertilize = 140;

    IF the OPERATION is 'Seeds' then NECESSARYGASOLINE = 120 * KM;

    OTHERWISE, if the OPERATION is 'Weed' then NECESSARYGASOLINE = 20 * KM;

    OTHERWISE, if the OPERATION is "Fertilizer" then NECESSARYGASOLINE = 140 * KM;

    Is it possible to translate it in Javascript?

    Thank you very much for the help! It would be really wonderful!

    Yes, it is possible. Use the following syntax:

    If (organic == 'Yes' & culture == "Wheat")

  • How to check the value of Disqualification working correctly?

    Hello

    I have problems using the processor to check the value in Disqualification. I want to check the customer name field for how many names contain 'TEST' in them. Here are the steps I follow, I hope that someone can identify where I'm wrong:

    1. Add checking the value

    2. in the ATTRIBUTES tab, add "Customer Name" as the field of Validation

    3. in the OPTIONS tab, add 'TEST' as against value to compare files, choose "is equal to", as the comparison operator, select 'Yes' to Ignore Case.

    In reviewing the data, I see many instances where TEST is in the name of customer - but the value record tells me that there is no example of this.

    Have I missed something obvious/fast?

    Thank you!

    Checking the value does not have a check Contains. Use the list check with the Contains option for this.

    You can press F1 on each processor for its help page if you are not sure about what he does.

    Mike

  • JavaScript to check the value of the Textbox

    Hi all

    I have a few simple javascript in the header of my page to check the value of an element... There is no errors in Firebug, but the alert window is also never coming.
    if ($v('P2_ITEM') == 'VALUE1')
    {
    alert('VALUE1');
    }
    if ($v('P2_ITEM') == 'VALUE2')
    {
    alert('VALUE2');
    }
    if ($v('P2_ITEM') == 'VALUE2')
    {
    alert('VALUE2');
    }
    Thanks for any help.

    Use double quotes in JS to check the string values:

    function test_choice()
    {
    if ($x('P2_ITEM') == "Test1")
    {
    alert("Test1");
    }
    if ($x('P2_ITEM') == "Test2")
    {
    alert("Test2");
    }
    if ($x('P2_ITEM') == "Test3")
    {
    alert("Test3");
    }
    }
    
  • HELP - lost the button "calculate" in the "text field properties"! I try to summarize the total for separate text fields in a summary box.

    Help, please!  I try to summarize the total for separate text fields in a summary box, but have lost the tab 'calculate' in the 'text field properties area.  Any help would be greatly appreciated!

    When in forms editing mode (Tools > prepare form), select: more > return to the Acrobat form

    In the future, check the box 'this document requires signatures' when you choose at the beginning: Tools > form prepare

    unless you plan to use the form with eSign Document Adobe cloud service.

  • Treatment options for form (use the value of a form field to select a shared list or a web redirect page)

    Hello

    I tried something with the processing of the forms which doesn't seem to work. I wonder if the function really works or if I'm doing something wrong.

    Here is an example of what I do: I have a form that I want to use. I add "Web Page redirection" processing step to my form. When I click on the processing step to set up, under "General settings" there is an option that says "Choose how the launch of destination page is selected." In this drop-down menu, there are three options: always redirect to the same landing page, use a drop-down list to select the landing page and the value of a form field allows you to select the destination page. I have a hidden field on the form that contains the URL of the web page to which I would like to redirect. When I select 'Use the value of a form field to select the landing page', I select the hidden field to the field that contains the URL of the web page to which I want to redirect. It's my setup. However, when I submit the form, nothing happens, I do not redirect to the URL contained in the hidden field... This function still works? I'm doing something wrong? I can't seem to get the function "Use a drop-down list to select the destination page" to work either. The same thing happens when I try to use the "Add Contact to shared the list" processing step. I add the name of the list that is shared in the field hidden, but the contact does not appear in the shared list... These functions still work? If yes how do I configure them?

    Thank you!

    Well, I understood the problem of the shared list... You must add the ID of the list shared in the hidden field. I had to use Firebug to see the real ID of the shared list. Once you have the ID, use you it as a static value in the field. If the HTML code of the form will look something like this:

    If you do not use the lookup data ID. You use the ID real asset on the shared list. You must use something like Firebug to find.

    I'm glad everything is working.

  • How can we make invisible static value in a text field to the OPA

    Hi all

    I have invisible static value in a text field in the OPA.

    For ex: field contains the value 100 while we manage the maintenance should not display the value 100 or make us the text as invisible field. whenever we submit the interview the value should be passed.

    I made the background color of the text in white field, but it reflects all the text fields. I need to make the text of the particular text as invisible field. Can someone give me a solution for it.

    Use two different attributes (the one that is indicated in the interview to the need - for example, as "the id selected user" or whatever the phrase is appropriate) and a different attribute, which is the mapped attribute.  The second attribute must not be on any screen of the interview (by thus "invisible" for the user).  Write a table of rules that concludes that the value of the attribute mapped on is EITHER static value or the selected/expected value according to some logic is appropriate to make a decision in your model of strategy.

  • Using OnChange or OnBlur for changes the value of a hidden field

    I have a need to update the value of a hidden field with the value from a menu of the list. I studied the OnBlur and OnChange JavaScript functions but can't find anything suitable. Here's the deal:

    If a user selects California on a list of State menu, I need to immediately update the value of a field hidden with the "California". (Both fields are on the same page) All this must occur BEFORE the user submits the page. Each time they choose the State from the menu to list the value of the hidden field must change.

    Can anyone offer any suggestions?

    Thank you!

    Well Yes, that did the trick for the hidden field. Thank you very much.

    I'll be able to also store this value in a session variable? (see previous post)

  • Create the hyperlink in a text field

    I have a form that collects data from a customer. The number of customers is their phone number. This issue is already known and stored in a "cPhone" text field in the form. After all data are collected on the form, I then need to browse the site of customers the last part of the url of the site corresponding to their phone number that is already stored in the field "cPhone. What I want to do is to create a hyperlink to the Web site, that ends in the number of customer phone and when you click it it will take you to this Web site. For example, the url of the Web site might be www.mywebsite.com/main/active/ and my clients, 'cPhone' telephone number is 800-555-5555, when some kind of action is taken, the two are combined, and then it takes me to this Web page.

    Is they are combined and an action is created to open a web link, or a hyperlink can be created on the page that can be clicked, or anything else in the meantime. Is this possible?

    Probably the simplest is to use a button. The action could be a JavaScript like:

    Script mouse upward to a button

    app.launchURL ("http://www.example.com/main/active/"+ getField("cPhone").valueAsString, true);

    In practice, you'll want to check the value of the number field phone to see that it is not empty and is over, but this should help you get started.

    You can use the buttonSetCaption method to set the label of the button to the URL, perhaps in the phone number field Validate event.

  • Problems with the filling of a text field with 2 other fields data


    I have 3 domains Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.

    Tools_1a_pri is a drop-down list box with a predefined list. One of the options is the 'other '.  If 'Other' is selected, the text Tools_1a_pri_other field becomes visible for users to enter the name of the other tool.

    The Tools_1a_pri_txt is a text field with a calculation that shows a text indicating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.

    When I select one of the predefined tools, everything works.  When I choose the other, it seems that nothing has changed.  Must I click another field before.  It's confusing for the user.

    Tools_1a_pri validate code
    this.getField("Tools_1a_pri_Other").display = event.value is "Other"? Display.visible: display.hidden;

    Computer Tools_1a_pri_txt code
    If nothing is selected, follow these steps
    If (getField("Tools_1a_pri").value.length < 2) {}
    event.target.textColor = color.red
    Event.Value = "no identified main tool";
    } else if (getField("Tools_1a_pri").value! = 'Other') {}
    If not do that if the other is selected
    event.target.textColor = color.black
    Event.Value = getField("Tools_1a_pri").value;
    } else if (getField("Tools_1a_pri").value = 'Other') {}
    If not do so if the other is not selected
    event.target.textColor = color.black
    GetField("Tools_1a_pri").value = Event.Value + "-" + getField("Tools_1a_pri_Other").value;
    }

    You have made the classic mistake of using the assignment operator in a statement instead of the comparison operator. Change this line:
    } else if (getField("Tools_1a_pri").value = 'Other') {}

    To do this:

    } Else if (getField("Tools_1a_pri").value == 'Other') {}

  • Try to retrieve the contents of a text field and use it in a conditional statement

    Hello world

    I have a form with a text field and a button. The text field is called "orderNo" and the button is called "genOrder".

    Initially, the text field is empty, and clicking on the button fills the text with an appropriate order number field.

    I have need to check the text field for the data (content) before you write the order number, in this way, if an order number is already present in the text field, it will be over written.

    My intention is to use an if / else structure to perform the tests, but I do not know how to retrieve the content of the text field (if the content is present!).

    If anyone can suggest how I can go about extracting the contents of a text field and then use it in an if / else statement it will be greatly appreciated.

    Kind regards

    DAVO

    currentOrderNo = this.getField("orderNo").value;

    If ("currentOrderNo == null | currentOrderNo ==" ") {}

    the field is empty, fill it with a new value

    } else {}

    the field is not empty, something else

    }

Maybe you are looking for