When a box is checked, insert text in another field

Hello

I know there has been a lot of another thread like this one, but for some reason that my code does not work.  I try to have text in a field when a check box is selected.  Can you please please help.

For a mouse an event:

var dateCheckbox = this.getField ("Date or");  checkbox

var detailField = this.getField ("expiry details");  field

If the "date or" is checked that change details of Expiration 'Hello '.

If (dateCheckbox.value == 'Yes') {}

detailField.value = "Hello";

}

Which mouse-up event do you use? In general, when you try to trigger something based on a selection of the checkbox, you should also take care of the disabled value. In addition, the value of exports of a checkbox control can be changed, is usually a better approach to check the value! = 'Off', because 'Off' will always be used if not controlled.

Try the following as the event of mouse-to the top of the "Date or" check box:

var detailField = this.getField("Expiration Detail");  //field
if (event.target.value != "Off") {
    detailField.value = "Hello";
}
else {
    detailField.value = "";
}

Tags: Acrobat

Similar Questions

  • I've created a form that uses the value field text to fill the text of another field.  Does not take into account changes

    I've created a form that uses the value field text to fill the text of another field.  However, if I need to change the text, the second field does not update this change.  Instead of reset the form each time, is the Javascript code to update the fields if they have been modified?

    For example I Text1 and Text2.

    When I type in Hello in Text1 I see Hello in Text2.

    Later, if I decide to change to Goodbye Text1, Text2 remains Hello.

    The shape of the hoe can recognize this change?

    Thank you

    Edit: I think I have misunderstood the situation.

    If you want to both fields have the same value, just to give them the same name.

  • reveal the pages when the box is checked?

    Hello

    I'm used to Acrobat Pro but new to LiveCycle. I need to hide several pages on a form until a user selects a check box. IE / user clicks on ' [x] category 1 ' and the page that contains the category content appears. If the user disables the check box, the page is hidden. IE / user erases [] category 1 and the page with the content disappears from the screen of the user.

    \i think it is called "revealing the page", but I'm not sure. Can someone point me in the right direction please?

    Thank you!

    Well, since I answered my own question, I thought I'd put the answer here just in case someone else can use it.

    First of all, some grumbling on LiveCycle: (you have to put up with this because this product is horrible and I had to pay a fortune to use...)

    • At that time, why pc only? I need only this one tiny but crucial function but was forced to borrow a pc and then buy a pc only (+ $ 300) software that I will use no doubt once again. All this should be feasible in Acrobat Pro with some scripts. (If your Google skills are best mine and you will find an answer, then please share it here and save the lives of others, the pain and the cost...)
    • Why is there a contempt of all feeling accepted, standard shortcuts - keyboard, mouse, and other methods of investment? Where is the ability to drag the guides of the leaders? Why can't hold the SHIFT key CTRL when dragging a form object to keep things lined up? BTW, ALT is how this copy - drag should be done - not CTRL. Where are the guides? Why, when I target an object in the generator of Actions I must scroll manually or collapse laboriously each page in the menu tree to obtain further to the bottom of the list? What a waste of my precious time and now unprofitable on this project.
    • I spent nice hours of creation of documents of approved customer in InDesign, only to discover that LiveCycle could not import my work in a way that preserves my layout, causing me to have to rebuild all my form elements. We are talking here of 9 documents and nearly 150 pages of provision of pain-staking, which had to be redone. And don't tell me that I should have used LiveCycle first. It should have been much more homogeneous than it was.

    Seriously, this product is expensive, not exhaustive, no standard compliant, similar to the use of Windows 95 in ways that no sane person should have to endure, but only pay for and put up with in 2014. Yes, Adobe high priests, I have in vain talk, knowing that this will fall indifferent, one ear deaf.

    OK - so here's the answer to my question. In summary, the steps to hide/reveal pages based on the user checking or unchecking a box are:

    1. Create the box by dragging the library of objects "Checkbox. Enter the question text and make sure that data binding name is unique for each instance. Let's say that all the elements of the box are on page 2 of the document. When the user selects the first box, three page turns. So, for this box, name it something like "CheckBox_Page3". Others would be called "CheckBox_Page4", "CheckBox_Page5" and so on.
    2. Select the first checkbox (let's stick with CheckBox_Page3 as our example.) and then right-click, choose Actions => add an Action (or Action change if there is an action already). The Action Builder dialog opens.
    3. I'm going to need two actions for each check box. One who says, 'If this box is cleared, then the page is hidden' and the other who said: "If this box is checked, then the page is visible." The Condition value: 'When the CheckBox_Page3 box is deselected' and the result of: show or hide a [HIDDEN] object. Then scroll down and select Page 3 in the left column.
    4. Set the action of the second so that the Condition is: "When the CheckBox_Page3 checkbox is selected" and the result of: "show or hide an object [VISIBLE]. Then scroll down again to select the Page 3.
    5. Browse all your boxes until all pages are put in place with a hidden/unchecked and checked/visible configuration.
    6. The last thing to do is to select all of the pages that will be hidden/shown in the left column. When this list is selected, visit the subform tab. Presence of the article and choose from the list: "Hidden (exclude from layout)." Now, the document will open with the appropriate, pages hidden from view, until the user selects the corresponding check box.

    Save OFTEN. Test carefully and on multiple platforms. Good luck.

    -Pete

  • When a box is checked, fill a text field with a value

    I don't know that it's simple; However, I am very new to acrobat and javascript.

    Here's what I want to do:

    I have a checkbox field and a text field. If the checkbox is turned "on" I want to fill the text field with a specific numeric value.  If she isn't 'unchecked' there is not value or value 0.  Any help is appreciated.

    Enter this code in the custom of your text field calculation script:

    This.getField("CheckBox1").value = Event.Value == "Off"? 0: 1234;

  • TextField mutiply by value when the box is check

    Hi all

    I have a form, built in Adobe Acrobat X Pro, I create as a form of reparation with charges included in it.

    I know how to have a value filled in a text field when a check box is selected.

    My question is this.  I have a textfield labeled as "labor_hrs" which is a number format.  What I want to do is to have this box multiplied by a given value of populous 45.00 to the text field 'labor_chrg '.  Can I get this feature to work on its own.


    I want to do is only to be filled to the "labor_chrg" when the "billable" checkbox is checked.


    adobe.png

    Any help would be appreciated.

    A quick way is to set the export value of the checkbox "billable" 1.

    You can then use the simplified field notation script of:

    (labor_hrs * 45) * billable

    A custom JavaScript calculation:

    function GetField (cName) {}
    Returns the field with error checking object;
    oField var = this.getField (cName);
    if(oField == null) app.alert ("field of error for access to the"+ cName, 0.1 ");
    return oField;
    } / / end GetField function;

    Event.Value = (isNaN (GetField("billable").value) == false) * GetField("labor_hrs").value * 45;

    If you add a hidden field to the rate of work called "labor_rate", you can use the ' field is the product of the following fields: "and select the fields"billable","labor_hrs"and"labor_rate ".

  • does not check messages when the box is checked

    Spin worm TB 38.2.0 on Windows 10. A check to check for new messages every 5 minutes in the server settings. He does not. Must hit receive messages to retrieve new messages. How can I fix it?

    Matt. I solved the problem by returning to the 38.1 version. Must be a bug in 38.2. Thanks for your thoughts.

  • Set the value of items when the box is checked

    Hello

    My requirement is when a checkbox is clicked it should set the value of an element such as 111111 and clear the values of two objects in a page of the apex.
    I used the java script onClick event to set the items using document.getElementByID ('Item_Name') = ";
    One element that needs to be eliminated is a type of conditional.
    When the element condional, java script works very well. But if it is not present.
    code works, but it displays "error on page" for a few seconds.

    Is it possible to erase the element only when the element is present in the page.

    Thank you
    Ravi

    Hello

    Yes as for example

    if($x("ITEM_NAME")){
     $s("ITEM_NAME", "");
    }
    

    Kind regards
    Jari

  • Overset text when you create a block of text to another object

    I apologize if this has been answered in other discussions, but the search function does not work now. I am trying to create a block of text on top a .pdf bound. I can create the block of text, but as soon as I enter the text, I get the text marker in excess on the frame, despite the fact that the frame is big enough to accommodate the text that I entered. This happens if I simply enter a single period.

    If I click on "mount the frame to the content" he develops vertically the text block until it is large enough to have a part that leaves at the edge of the linked .pdf below, and the text that I entered appears here. Of course, now, I have a block of text that is 20 times bigger that I need, and I still have no text in the position where it is needed.

    Here is a link to a screenshot:

    http://Tinypic.com/r/i3vqjs/7

    I'm still a newb on InDesign, and I hope that there is an easy solution to embarassingly on this point I should have, but any help is appreciated.

    Thank you

    You probably dressing applied on the structure with the PDF file. Either remove it, or open the options of text block for your frame on top and check the box to ignore the dressing.

  • How to insert text from another software?

    In Photoshop, I need a text with a particular font, which does not have Photoshop. However, I can do in Word, that has this policy. The question is: how to transfer (or export) this text from Word to Photoshop?

    If you have two Photoshop & word on the same machine, there could be a problem with the font or the font you are looking for is at the bottom of the list of the fonts because of an incorrect header. To make you scroll all the way to the bottom of the list of fonts to see if she was placed in a different category?

  • Automatically copies the text in another field w / different name

    I feel stupid not knowing the answer to that, because I've been messing around with this stuff for so long... But there must be an easier way to do what I do.

    I have two textfields... "Name" and "Name_Clone"... I want to 'Name' to a user input, but I want to automatically copy whatevers in in "Name_Clone" as well...  The reason for this is because I'm going to do "Name_Clone" sometimes hidden, but 'Name' will always be visible.

    As I said - stupid question, easy answer.  What is the simplest code for this?  Thank you.

    Use the custom in the name field validation script:

    getField("Name_Clone").value = event.value;

  • Checking a box to check puts the text in a textbox

    Hi guys,.

    I am struggling to find a code example for the scenario really simply, a (Checkbox1) checkbox is checked and pre fills a text box (Textbox1) with "blah blah blah".

    When the box is unchecked, the text disappears.

    Can someone help me?

    You can try the following as the mouse struggle for the checkbox control:

    If (event.target.value! = "Off") {//If checkbox is checked

    this.getField("Textbox1").value = 'blah blah blah ';

    }

    else this.getField("Textbox1").value = "";   Clear the text field if the check box is unchecked

  • Check box to change the value of the field and reveal hidden text

    Hello

    I need to change a value in a field when you press a checkbox

    the default value can be $ 10 in 'formfield1 '.

    But when the checbox is checked, the value of 'formfield1' must spend $ 8

    I also need a reval text function in "textfield2' of the text hidden to visible.

    Is it still possible to combine in a box?

    I found a code on the forum and changed it, but it does not work as expected, it affects the field, it shouldn't and it behaves a bit funny, here is the code to calculate.

    I also tried to change the value of Off to On, but who has not reversed the procedure than I hoped.

    Well its a start, maybe someone can understand a give me help on the way?

    ________________________________

    custom for the discount calculation

    var nDiscount = 2;

    name of the Sub total field

    var cSubTotal = "formfield1";

    name of the non-Discount checkbox

    var cbNonDiscount = "CheckBox1";

    default value for the non-Discount

    Event.Value = 10;

    see if the purchase is with discount or not non-Discount

    If (this.getField ("cbNonDiscount") .value == 'Off') {}

    Event.Value = this.getField ("cSubTotal") .value - nDiscount;

    }

    put an end to a custom calculation

    Ah, if you want the calculation to take place when the box is checked, use this:

    If (this.getField (cbNonDiscount) .value! = "Off") {}

    Instead:

    If (this.getField ("cbNonDiscount") .value == 'Off') {}

  • How to disable a checkbox when the other is checked

    Hi, I'm a first time user.

    I am doing dissapaer and strips of text fields when the boxes are checked. but only alow a box to be active at the same time.

    I do a simple form in Acrobat 9 pro.

    I have two checkboxes Checkbox1 and Checkbox2.

    I have two text Textfield1 and Textfield2 fields

    I added shares to checkbox1 and checkbox2 to "hide or show" text fields.

    Action-> on focus (checkbox1) show/hide field (textfield1) is hide

    Action-> on focus (checkbox1) show/hide field (textfield2) is to Show

    Oposite

    Action-> on focus (checkbox2) show/hide field (textfield2) is hide

    Action-> on focus (checkbox2) show/hide field (textfield1) is to Show

    problem 1 - how to disable checkbox1 when the 2 checkbox is checked.

    or disable checkbox2 when checkbox1 is checked.

    my other problem is that this action has the same effect for checking or unchecking the box.

    Thanks in advance to anyone who can help you.

    can you please write your answer in simple terms. Basically, it's the first time I've used acrobat pro so please do not assume that no matter what knowledge at all. Thank you very much.

    First of all, I experience a few boxes to tick, and learn their properties and how they interact.

    Have you tried to use the same name for 2 checkboxes and assign one other "export value" for each checkbox.

    Have you looked at the values a check box or boxes have when checked or unchecked?

    Have you looked at how to work the various actions for a field?

  • Cursor (cursor) appears in the text box after inserting text or the position of change

    I managed to change the position of the cursor in a TextArea as qml and C++ to help through the Publisher associated with the drop-down list.

    I checked the change to receive cursor, change of position and position again.

    However, the cursor does not appear or is not visible in the TextArea component. When I tap on the screen the cursor is displayed again.

    The cursor disappears when I insert text at the cursor position.

    No idea why or how to control the visibility of the cursor in this situation.

    I know you probaably you want to see the source code is here

    textArea.editor.insertPlainText ("plain text");

    Hello

    The cursor/caret is not visible unless the text box is focused. Code like this work for you?

            TextArea {
                id: ta
            }
            Button {
                text: "Click Me";
                onClicked: {
                    ta.editor.insertPlainText("plainText");
                    ta.requestFocus();
                }
            }
    

    Thank you.

  • How stop the little black box that is a copy of what is on my mouse to come when I put it on the text?

    Original title: changes of mouse

    How stop the little black box that is a copy of what is on my mouse to come when I put it on the text?

    Hello

    1. have you made changes on the computer before this problem?
    2 have you tried to change the theme or settings and check mouse?

    Read the following article which can be useful:

    To change the appearance of your mouse pointer
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/WIN_POINTERS_CHANGING.mspx?mfr=true

    If possible, send us a screenshot of the mouse pointer which could help us help you better.
    http://social.answers.Microsoft.com/forums/en-us/w7security/thread/c86de820-C620-401c-A804-9f6337cd3053

Maybe you are looking for