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') {}

Tags: Acrobat

Similar Questions

  • Is it possible for someone to insert a logo when you fill out a form to fill out? I'm looking for all the options under the button 'add a text field.

    I have created a form to fill out that is a contract, but I need a way for the person who is to fill the form to insert their logo.  Is it possible for someone to insert a logo when you fill out the form to fill out? I'm looking for all the options under the button 'add a text field.

    It is not possible within a text field, either. If they have Acrobat, they can use the built-in under Tools - editing content Add Image tool.

    If they drive XI or higher, they can use a button form field you will need to set up for them, but the image must be in PDF format.

  • 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

    }

  • 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.

  • 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"));

  • NULL text field, how to fill in another text field

    I would like to be able to invite the user to fill one of two text fields, if for example they fill in A text field, then no guest would jump to the top, but if they don't fill in the text field then a prompt would leap upward by asking them to fill out the text field B.

    Thank you

    Hello

    One way would be to place a JavaScript in the output of TextFieldA event:

    if (this.rawValue === null) {
         xfa.host.messageBox("Please complete Text Field B", "Attention", 0, 0);
    }
    

    However this fires when the user leaves TextFieldA. You may need extra script if it is likely that the user is not yet in this text field.

    Niall

  • Try to highlight the rectangle of a text field

    I'm trying to point out the rectangle of a text field with an Annotation of the line, but I'm a bit confused.

    The first doubt is on the 'Square' vs 'Rectangle' annotations What is the difference between them? Adobe has those changed recently?

    I tried several variations of the following code snippet:

    var x 1 = textField.rect [0];
    var y1 =
    textField.rect [1];
    var x 2 =
    textField.rect [2];
    var y2 =
    textField.rect [3];

    var this.addAnnot({) = underline
    page: 0.
    type: 'Line ',.
    Rect: [x 1, y1, x 2, y1],.
    strokeColor: color.red,.
    strokeWidth: 160
    });

    What I get is a line of identity (e.g., 45 degrees) in the lower left corner.

    -Ramon

    The square rect sets top-left-x, top-left-y, down, left - bottom-left-y and x.

    For a line, it is left-x, left-y, x-right, right-y.

    So if you want the line to be under place, use the background values of the place to place the line.

  • 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

  • change the visulas of a text field

    Hello!

    How do heck you change the attributes of a text field that is in a form. IM particularly interested in the color and size of the box itself. I guess that this is done in css, if so that the CSS properties do change?

    Thank you very much and MERRY CHRISTMAS!

    Does that help?

    http://articles.SitePoint.com/print/style-Web-Forms-CSS

    Martin

  • The legend of a text field border

    Does anyone know how to get the edge of the legend of a text field and the value section is visible to a user of the form?  It's a bit confusing when someone enters a field, and there is no line between the legend, they can't change it, and the value, they need editing.

    Choose different skins for the field will make very clear. If you choose to have no appearance there is no deliniation between the two. You can set up to change the background color of the zone to enter and deliver it to the output. This technique will highlight the field that has the focus, and there is no doubt as to where the field stops and starts.

  • Hi, I just upgraded my 4s to 9.3.2 and now it is completely dead and will not start. Had no problem with any other previous updates.

    Hi, I just upgraded my 4s to 9.3.2 and now it is completely dead and will not start. Had no problem with any other previous updates.

    Sorted now

  • How do fill you a text field based on the entries in other text fields?

    I would like to be able to have a text field that fills as 'Full' or 'Incomplete' based on the question if all required fields have been filled or not.

    For example, if the "First Name", "Last Name" and "City" text fields are not filled, the text of "the State of completion" field displays 'Incomplete' and once they are filled, the text of "the State of completion" field will turn into "Complete".

    How can I do this using javascript? I searched the web for a tutorial, but most of the results seems to be focused on the menu drop-down.

    Please point me in the right direction!

    Try the script below. I put this on the calculate for Field1 event

    If (FirstName.rawValue == null |) LastName.rawValue == null | City.rawValue == null) {}

    Field1.RawValue = "incomplete."

    }

    on the other

    Field1.RawValue = "complete."

  • How can I change the contents of a text field in a PDF form with a defined variable?

    Hi all!

    First time poster and getting quite frustrated trying to understand this issue. Here's the scenario: I use Acrobat Pro 10 to create what is essentially a form of giant order. I have designed the document in InDesign, defined the various buttons and other whatnot and then it exported to Acrobat to continue the construction of the form.

    I have a radio button group called 'conference_opportunities' that contains different options at different prices, so they are all the same, but have different values (so that they belong to the same group and only one can be selected at a time).

    What I've done is created a 'MouseDown' event on the button that sets a variable called 'ConferenceOpportunity', which is equivalent to the title of the option they pick. Then, I want to take this variable and display in a text box called "Conference_Option". I use a variable because my radio buttons values are actual prices of the option they pick, so I can't set the value as the title of the option.

    If its an array of boxes and option at the bottom of the page, there is the Option that they selected, the quantity (which can change) and value (in dollars)

    I also then want to display this variable at the end of the document as a kind of summary of what they have chosen to buy as well, but I guess it's the same code.

    I'm not an expert at all Javascript, so code snippets would help greatly. I looked on the Document from Adobe on the SDK and API and have not been able to find a solution. I also turned to the Almighty google and still no luck.

    Any help would be greatly appreciated!

    Thank you all

    Right now, you have to do is use this variable to the value property of your text field... Then add this at the end of your code:

    this.getField("Conference_Option").value = ConferenceOpportunity;

    Also, I would use not MouseDown, MouseUp.

  • Click and drag in the Favorites or in text fields does not

    Click and drag does not work with favorites anywhere, or any text fields. He used to work a lot in v11, but not v12

    I tried to revert to my version of Firefox v11 backup but it keeps automatically updated to v12 despite disabling auto update in the preferences and even when it is offline - frustrating.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • How to limit the length of a text field in a dialog box (ADM)

    Hi all

    I need to limit the length of a field in a dialog box (ADM) edit_text, but char_limit doesn't seem to work, it's my code the problem ?

    {
    char_width: 8.
    height: 100,.
    item_id: 'Rete ',.
    type: 'edit_text. "
    Multiline: true,
    char_limit: 5.
    Width: 500,
    }

    If not, maybe I can use events to do the same thing with the onKeyStroke event but I don't know how to use the event in a dialog box (ADM) or if it is still possible...

    Any idea?

    Thank you for your help.

    Phil

    There are two events that can be used to check the length of the text,

    The first is the action event for the text field, which is called when the field loses focus, it is a member of the purpose of dialogue with the same name as the item_id.  This event could also be used to update another field in the dialog box that indicates the number of characters, you may even have a small picture of alert which becomes visible to make it obvious that there is a problem.

    The other event, as already mentioned, is the validate event.  This allows to block the exit from the dialog box and display a popup to alert to the user.

    You will find some examples of dialogs here:

    http://www.pdfscripting.com/public/65.cfm

    Take a look at the pages resize tool dialog box.  It will give you some ideas of what can be done.

    There is a plug-in Acrobat for creating dialogs here:

    http://www.windjack.com/products/AcroDialogs.html

    It's a Visual drag and drop Editor.  You can download and use for free for 10 days.

    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)

Maybe you are looking for