How can I make a box autopopulate a text field

I have 2 text fields named MailingAddress and GarageAddress.

I would like to have a check box next to my MailingAddress the field when checked would be autopopulate my GarageAddress with the value of MailingAddress.

I scrounged around forums and cobbled this together (with my very limited knowledge of JavaScript)... but get a syntax error.  I'm sure it's something obvious... If you understand JavaScript!

Any help would be greatly appreciated

var aMailing = this.getField ("MailingAddress");
var aGarage = this.getField ("GarageAddress");

If (this.getField (event.target.name) .value is 'Yes')
{
copy the mailing address to the address of Garage;
aMailing.value = aGarage.value;
}
aGarage.readonly = true; do GarageAddress readonly;
}

on the other

{
aGarage.readonly = false; clear readonly
this.resetForm ([aGarage.name]) / / reset GarageAddress
}

You have syntax errors in your code. Also, it seems that the logic of your code is reversed. You copy the value of GarageAddress to MailingAddress, instead of what you have described. I suggest using this code (as the MouseUp event of the checkbox) instead:

var aMailing = this.getField("MailingAddress");
var aGarage = this.getField("GarageAddress");

if (event.target.value == "Yes") {
    // copy Mailing address to Garage address;
    aGarage.value = aMailing.valueAsString;
    aGarage.readonly = true; // make GarageAddress readonly;
} else {
    aGarage.readonly = false; // clear readonly
    this.resetForm([aGarage.name]) // reset GarageAddress
}

Tags: Acrobat

Similar Questions

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

  • How can I validate numeric values in a text field?

    Hello

    Once more, I have a problem.

    I have a field in which the user must enter 10 digits in the model 999999-9999. The field should contain only numbers and must be exactly 10 characters. I have a validation script on the button "print", which prevent printing if required fields are empty or not properly filled out.

    I tried two ways of working this point, and I'm not satisfied with any of them, I can always print despite warning messages and validation scripts.

    1.

    I put the type numeric field, limited to 11 characters.

    Display model num {999999-9999}, change the model num {999999-9999} and validation model num {999999-9999}

    Problems using this solution: when I type 11 digits in the field (ex.12345612345) I get a warning message and 12.345.612

    But when I type 9 digts (e.g. 123456-123 or 123456123) I get no message warning and 000000-0000 or 012345-6123

    If I type alphabetic characters (e.g. 123456 abcd) I get no warning message and 000000-0000.

    2.

    I put the field in the text field, limited to 11 characters.

    The model text {999999-9999}, edit text model {999999-9999} and {999999-9999} model validation

    Now, when I type 11 digits in the field (ex.12345612345) I don't get any warning messages and 12345612345

    When I type 9 digts (e.g. 123456-123) I get no warning message and 123456-123

    When I type 9 digts (e.g. 123456123) I get a warning message and 123456123

    If I type alphabetic characters (e.g. 123456 abcd) I get a warning message and 123456 abcd.

    It works a little better as a text field, but I'm not satisfied at all.

    Someone at - there a solution to this?

    Additional I also want the hyphen to emerge automatically when you type.

    K

    Regular expressions are useful for this type of validation. The code below tf1 is a text field with a maximum length of 12.

    Form1.Page1.TF1::exit - (JavaScript, client)

    If (!) ((this.isNull))) {}

    var FO = this.rawValue;

    \d to match any character in the range 0-9

    regExp var = \d{6}\-\d{5}/;

    If (!) () {regExp.test (tf)))}

    xfa.host.messageBox ("the field must be in the format of 123456-12345.", "Validation", 1);

    }

    }

    {The \d{6}\-\d{5}/ expression tests 6 digits \d{6}, a dash-- and 5-digit \d{5}.

    Steve

  • Firefox not to remember passwords. I check the "Remember passwords for sites", however, whenever I restart Firefox, uncheck the box "Remember passwords for Sites". How can I make the box "Remember passwords for Sites" stay enabled?

    I'm running on a platform of Windows 7 desktop. I have looked for similar problems in a number of forums, but have not seen all the signs that work in my situation.

    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 can I make a box colored around each line of text in a paragraph?

    I want to create a color block around or behind the text I type in a paragraph. Something similar to a highlighted in each line of text rather than the paragraph as a whole.

    All opinions are appreciated.

    Another way is to use paragraph nets. Simply adjust the weight, color, width and the Offset.

  • How can I make check box, once in POWER, Auto Fill a text field?

    Hi all

    I need a little help with this pdf form. I'm doing the checkbox, when checked "on", said a message as "I agree to this form", in the text to right field. Any help would be great! Thanks in advance!

    My form is attached...

    Hello

    Script like this will get what you want:

    if (this.rawValue == 1)
    {
         MessageBox.rawValue = "I agree to this form";
    }
    else
    {
         MessageBox.rawValue = "";
    }
    
    Annex specimen.
    Good luck
    Niall
  • How can I make multiple copies of a text with my desktop Windows Vista/Dell computer?

    I asked a simple question; Why is it so hard to answer?

    Please clarify what you mean by "making several copies of a text".  Please site an example of what you want to accomplish and we'll go from there.  Thank you!

    Here is the message I want to distribute paper copies to the members of a group called seekers of Justice, some of whom have no computers:

    "Please attend the next meeting of the seekers of Justice, which will take place next Friday, when we discuss topical issues".
    I know there's a way relatively simple I should be able to do but am confused so far. Would appreciate your help. Norm Williams

    Have you considered connecting a printer all-in-one to your computer > right click on the message > click on print > the next area you will be asked "how many copies '...

  • How can I make a single line of text (within an existing paragraph) more small?

    I have a paragraph in an existing site, and the client wants to make the last sentence of the smallest. It's something I've never done and my attempts have so far failed.

    The site is www.ourhealthcarecrisis.com and the line of text at the bottom of the column on the right "(Ahmed vers le bas pour voir) '."

    Thank you

    Insert a tag around the text:

    It's smaller text

  • How can I change the caption on a text field using data?

    Hi, I have read that it is possible to do, but when you have an xsd file, I use a data xml file preview, so there is no way to link them together, any ideas?

    Thank you!.

    (1) in the designer, tools > Options

    (2) in the left pane, select data binding and display dynamic properties is checked

    (3) to select the field you want the legend to be driven by XML

    (4) in the object palette on the field tab you will notice Caption is now green and underlined, click it.

    (5) If your form is bound to a schema you can see the hierarchy when you press the button next to the entry link or in your case to access the Caption attribute in your XML type > $. textField1.Caption

    Assuming that "$" is your root node.

    Kyle

  • How can I change the size of a text box without moving boxes?

    This is my problem:

    Regularly, I have several text boxes in a row area and need to extend the boxes to display all the text. I used the direct Selection tool to select all the boxes and then use the Middle bounding box handle to drag the boxes longer. When I do this the position of the box moves as well. If I type a number for the height of the boxes, it extends the type.

    How can I make the boxes more time to show all the text without moving the boxes?

    I use Illustrator CC2015 on Windows 7.

    Thank you.

    OK, I see now, this is happening to me also. But on a much smaller scale, so did not notice. My Y was pt 178. After scale if has 179.247

    1. With nothing selected appears hovering over the region, which I marked in red at the bottom of the pane click
    2. Hold the SHIFT key, click on the second box
    3. Click and drag on the 3rd bottom of the text pane and drag down.

    Who has taken my y-axis, let me know if it works on windows? Don't know how to get the tool to work.

  • How can I make the label to go on top of the text box?

    How can I make the label to go on top of the text box?

    Thanks again,
    Doug

    Set the label of the horizontal / Vertical alignment for the textarea to the aboveproperty.

  • How can I make multiple selections in a list box fill a different text box?

    I have about 100 items in a list box.  However I should never select up to 10 items at a time.  So, since it would fill pages that the entire issue of items to see which are selected at a glance, I'd like o keep the small list box, and I select the elements they have appear in a different text box...

    I have Acrobat Standard XI, is this possible and if so, how?

    Thank you

    You can use this code as the custom text field calculation script, but it will update as soon as you leave the list box:

    var v = this.getField("List Box1").value;
    if (typeof v=="string") event.value = v;
    else event.value = v.join(", ");
    
  • How can I make the work/look like a Thunderbird 2 Thunderbird?

    I used Netscape/Mozilla/Thunderbird Mail since the middle / end of the 1990s and was disappointed by the changes after Thunderbird 2, so I went years of Claws Mail, but it is not enough for everything. How can I make Thunderbird current work/look like version 2? In other words, I would turn off the tabs for messages & research, including all traces of what it looks like a label, or space curved GUI / additional shadow separated, so also have only a single search box that will search and display in the current folder box and keep the menus easy to use (with shortcuts that appear when you type) standard for GUI programs While getting rid of the imitation chrome button. I guess that the tabs are okay for things like dealing with Add-ons, but that's all. Maybe there are other things I can think. I know that most/all this can be done in terms of configuration and I think a lot of people would like that there is a full article on it. Virtually everyone, many people that I talk about e-mail also let Thunderbird for all these reasons, of it being too influenced by web browsers, and the IRC channel is virtually dead, so I came here, hoping that this place is not as dead with what happened with the project (announcing that no major update will be When most of the people preferred it maybe before the latest GUI major updates)

    Seriously. You're in the minority, I think.

    No one took the trouble with this stuff since V3 came out. but I wrote a blog postabout this 5 years ago and Mozillazine did a knowledge article database that went further than my blog post. But I wanted to just my menu bar headings message and back small Mozillazine entered CSS change and I think some that can be made obsolete by Australis was two years ago. But if you want to go.

  • How can I make a list of all bookmarks as my homepage?

    How can I make a list of all bookmarks as my homepage?

    You can set one of these pages as startup page:

    • chrome://browser/content/places/places. XUL
    • chrome://browser/content/bookmarks/bookmarksPanel.XUL

    The first one opens the Manager of bookmarks (library) and the second the bookmarks that see you in the box to Favorites (Ctrl + B; View > sidebars)

  • How can I make sure that my kids use no other direct email addresses?

    Summary of the issue
    Other issues of Windows Live family safety

    What version of Windows Live Family Safety do you use?
    Version 2011 (15.4.3538.513)
    Choose your operating system version:
    Windows 7

    Additional details
    My son can connect to her fine Hotmail account, but it can also connect using other Hotmail or Live email addresses. How can I make sure that it can only connect to Hotmail with their family safety account?

    Hi iclay,.

    I have reproduced your concern in our end and I discovered, add other e-mail accounts that he can use and accounts already created by your son in Windows Live family safety and block the Windows Live Hotmail registration page to prevent it from creating an another workaround e-mail accounts.

    To add e-mail as child account in Windows Live Family Safety:

    1. connect your account on http://fss.live.com.
    2. under Family summary, click on Add a new child.
    3. log on to the account of the child

    After that, the child's account appears as a member of the family under the new parent account.

    To block the registration page:

    1. on any computer, connect on the parent account to the safety of the family home page
    2. click Edit settings under the name of your son, and then click Web filtering lists.
    3. enter http://signup.live.com in the box and click on block.
    4. click on Save.

    Please inform us if you have any questions or concerns, we will help you gladly with him.

    Thank you

    Christian C.

Maybe you are looking for

  • Bluetooth does not work in windows 8 64-bit in the sony vaio sve15123cn model

    I have laptop sony vaio e series. Bluetooth doesn't work does not correctly. Please send me suggestions.

  • Black Screen HP G62-b16st and ati radeon hd 5470

    Hi, I have a problem with my laptop (Hp g62 - b16st) I use this laptop for 2011 and I didn't have any complain so far, but 3 days ago when I played PES 2013 he suddenly restarted then blue screen name appeared. I did some research on google about thi

  • How can I create discs for my recovery to reinstall partition Vista?

    I have a Dell Studio 540 I bought in 2009 which came with Vista 64-bit pre-installed. I do not have the installation discs for Vista but rather has a recovery partition (D). I don't create discs of backup at the time. Now my hard drive is about to cr

  • Placement of NetFlow with MARS50

    Hello I'm deploying a MARS50. We have a WAN aggregation router followed by a team of PIX535s then a router of aggregation of Campus. Both routers are 6500 s with JOINT-2. I know that the MARS50 is low power for our deployment, so we try to get the mo

  • PE4 of installation on a Macbook Pro

    Recently, I bought PE13 for Windows to install on my other laptop (Windows).I also have a version of PE4 for MAC/OS.  Installed only once on an iMac, two years ago.Tried to install on my MacBook Pro, but it stops during the installation process. With