JavaScript: Use a dropdown to change visibility of other fields

Hello
I'm new here and hope you can help me.
I have no JavaScript experience. I've tried a lot, but it doesn't work so far.
I use Adobe Acrobat X (Version 10.1.9).
My idea:
A User should select his country in a dropdown. Depending on the user's selection, appears another dropdown. If no country is selected, no other dropdown is visible.
When the user select the country "England" the dropdown "EnglandAreas" should get visible.
When the user select the country "Scotland" the dropdown "ScotlandAreas" should get visible.
etc
Now I think there are two ways.
1. For each country it has an own area dropdown. When the user opens the document, all area dropdowns are hidden. The User select his country and a JavaScript set the correct area dropdown visible.
2. For all countries there is one area dropdown. When the user opens the document, the area dropdown is hidden. The User select his country and a JavaScript fills the area data of the selected country in the area dropdown and set the area dropdown visible.
Which method makes more sense or is there a third method?
One of my non-working code (try method 1):
var co = this.getField("Country");
var aren = this.getField("AreaEN");
if (co== "England") {
event.value = (aren.display = display.visible)
} else {
event.value = (aren.display = display.hidden)
Thanks for all the help.

Where is that code placed, exactly? It should be something like this:
// Get a field value and a field object
var co = this.getField("Country").valueAsString;
var aren = this.getField("AreaEN");
// Set the visibility of the AreEN field based on the selected value
if (co == "England") {
    aren.display = display.visible;
} else {
    aren.display = display.hidden;
But the correct code does depend on where it's placed.

Similar Messages

  • Primitive data changes visible to other threads?

    I thought that if one thread changes an instance variable, the change may not be visible to other threads if synchronization is not used.
    Today I read that primitive types whose assignment is atomic are an exception. Is that correct?
    Maybe I'm not clear about the original idea. Is it simply that another thread might be in the middle of a method where the old value is in use? Or is it more complex than that? For some reason, I had it in my head that each thread somehow maintains its own "view" of memory.
    Thanks,
    Krum

    I think you are mixing two different things here.
    The assignment of most types are atomic. They either contain a value or not. This does not nessecarly mean that they are written to the main memory, they could still be in the thread-local memory area. Once they are being transfered, the transferation will also be atomic. Example of non-atomic is that longs and doubles are assigned the first 32 bits and then the rest of the 32 bits. This would for instance if two threads wrote to the shared memory, you could end up with the first 32 bits belonging to the change made in thread 1 and the last 32 bits belonging to thread 2.
    So, for a method that is not declared synchronous but assigns one single value before returning is "thread" safe in the aspect that one thread will manipulate the data on at the time. This does not however guarantee order. So, thread 1 can enter the method but not do the assignment, thread 2 enters the method, does the assignment that is imidiatly written over by thread 1. Synchronous would make sure that thread 2 could not enter until thread one written it's change.
    There is a reserved keyword 'volatile' in java that has the purpose of warning JVM's that a variable is not allowed to be stored in thread-local memory space, but as far as I know, no JVM implements this functionality properly.
    What the article states is that if you only do one assignment or return it will be executed atomically as long as we are not using long or double. It is a bit braver than I would say, since technically an reference assignment can be atomically assigned before the object is actually created (se articles from Doug Lea about the failure of double-checked locking ) and therefor some thread problem could occur as it might use an object before it is actually there.
    Regards,
    Peter Norell

  • How do you use a drop down menu to populate other fields?

    I am creating a PDF that upon choosing from a list of People their address, phone, etc will automatically come in the remaining fields, or if a new person is choosen than you can add names address phone and it will save for future referrence ?
    Any help would be appreciated,
    THank you

    Thanks for your comment.
    Try doing this:
    Connect the form to a database and bind the fields in the form to the associated nodes in the data source so the data values automatically appear in the bound fields when a name is selected in the list.
    Add scripting to the list of names so the associated fields for address and phone number appear only when the user enters a new name and needs the other fields to enter new data.
    If that doesn't work, please provide more information about what you are trying to do. For example, here are a few questions to consider:
    Q. What object are you using for the list?
    Q. You say you want to be able to choose a person from a list of People, and their address, phone, etc automatically appears in the remaining fields address and phone number. What do you mean by etc. That is, exactly what objects are you planning to use for the other fields, and how many fields are there in total?
    Q. Is your form connected to a data base, which can supply the data values for the address and phone number fields.
    Q. What do you mean by 'a new person is chosen'. Normally the options on a list are pre-determined and added when you create the form. Do you want users to be able to add a new name to the list, and then enter that person's address and phone number in some adjacent fields?
    Have a look at these sections in the Help to gain a better understanding of what's involved:
     Working with Data Sources
    http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/000844.htmlhttp://livedocs.adobe.com/livecycle/8.2/acrobat_designer/000844.html 
    Buildling actions in forms
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000109.html#1627696 
    Thanks,
    Drew

  • When "Save Link As..." is used, file permissions are changed so that other users of the same computer have full access.

    I have a laptop running Windows Vista Ultimate, and I'm not sure what's been changed in my Firefox, but now, every time I use "Save Link As...", the user permissions for the file have been set to include "USERS" which is then indicated by an icon in the bottom left corner of the file thumbnail. The icon is of the two people you see under "User Accounts and Family Safety" in the Control Panel.
    I do remember a dialogue box coming up saying something about "This file originates from another computer and may be harmful..." or something along those lines when this problem first occurred.
    I thought that problem would only occur for files from one website, but now, whenever I try using "Save Link As...", the user permissions for that file are incorrect.
    If I open the link and download the file manually, it's perfectly fine.

    It seems that the difference between the sites that will open and the one that won't is the Default Authentication provider is set to NTLM on those that open, and Negotiate (Kerberos) on the one that won't. The Authentication Provider for the Default zone
    is Claims Based Authentication on all the sites, just site B (which won't open) is set to Negotiate (Kerberos), the others are set to NTLM.
    Short term: can I change the provider to NTLM without destroying the site?
    Long term: point me in the direction for setting up Kerberos correctly on my server/farm, as from what I can tell Kerberos is the recommended path forward. I'll setup a non-production test site and get it figured out.
    Thanks much.
    Steven

  • SAP MDG - How to activate user settings for Dropdown box Change request?

    Hello Expert,
    I have a question related to Hide DropDown Box Change request.
    When i save change request via collective processing, Change request Dropdown box is displayed. When, i select Change request dropdown list, only change request description is displayed,  not change request number.
    So how to activate access key from user settting ? Could you show me the menu path in order to activate it?
    Best regards,
    RAOELISON

    This is a generic Web Dynpro question and not specific to MDG. Any way, this is how you can do it:
    Right-click the field
    Select: Use Settings --> More
    Check the "Key Visible" checkbox
    Keep in mind this is a user-specific setting and not a global setting.

  • How to use a dropdown in a workbook which can work in different queries?

    Hi Experts,
            I have created a workbook which can display the query by using the 'Push Button'. One query is based on material analysis and another one on product analysis.
            It works good..
            In that workbook, I want to use a dropdown so that it can display the required key figure. (Note : In both the queries, key figures are same.)
            While selecting the keyfigure option in the properties of dropdown, the target data provider is not visible.
            So, pls help me to use the dropdown which can work in both the queries.
    With Regards,
    Yokesh Kumar.

    Hi,
    After fixing the error in the role I noticed that all I should do is to publish the querry in a new role.
    From that moment a user that is tied to new role can read the old report using the rights associated in a new role.
    Thanks for help.
    Regards. Leszek

  • What is the use of  dropdown box in wad in bi-7

    what is the use of  dropdown box in wad in bi-7

    Hi,
         Dropdown box in WAD is for changing the output of full or particular part of template at runtime.
    For Eg. suppose u have states in dropdown box and u want the output of according to particular state then u select that state from dropdown box. so the output comes accordingly.
    For doing these u have to assign a data provider to dropdown box which query give the output of states. and in the property of dropdown box u hav to assign the item which will affect by this dorpdown box.
    I think it will help u.
    Assign Point if it helps.
    Regards,
    Ravi

  • How I can change visible property of an af:table with an af:selectOneRadio?

    How I can change visible property of an af:table with an af:selectOneRadio? Anyone can help me with a tutorial, example or link?
    Thanks in advance.

    After you add the required libraries to your classpath
    you can do your use case as explained in this sample
    page source
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="untitled2.jsf" id="d1">
            <af:messages id="m1"/>
            <af:form id="f1">
                <af:selectOneRadio label="radio" id="sor1" autoSubmit="true"
                                   valueChangeListener="#{ControlVisibilty.onRadioSelected}">
                    <af:selectItem label="0" value="0" id="si1"/>
                    <af:selectItem label="1" value="1" id="si2"/>
                </af:selectOneRadio>
                <af:table value="#{bindings.DepartmentsView1.collectionModel}" var="row"
                          rows="#{bindings.DepartmentsView1.rangeSize}"
                          emptyText="#{bindings.DepartmentsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.DepartmentsView1.rangeSize}" rowBandingInterval="0"
                          selectedRowKeys="#{bindings.DepartmentsView1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.DepartmentsView1.collectionModel.makeCurrent}" rowSelection="single"
                          id="t1" partialTriggers="::sor1" visible="#{ControlVisibilty.table}">
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.DepartmentId.label}" id="c1">
                        <af:inputText value="#{row.bindings.DepartmentId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.DepartmentId.label}"
                                      required="#{bindings.DepartmentsView1.hints.DepartmentId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.DepartmentId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.DepartmentId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.DepartmentId.tooltip}" id="it1">
                            <f:validator binding="#{row.bindings.DepartmentId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.DepartmentId.format}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentName.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.DepartmentName.label}" id="c2">
                        <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.DepartmentName.label}"
                                      required="#{bindings.DepartmentsView1.hints.DepartmentName.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.DepartmentName.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.DepartmentName.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.DepartmentName.tooltip}" id="it2">
                            <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.ManagerId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.ManagerId.label}" id="c3">
                        <af:inputText value="#{row.bindings.ManagerId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.ManagerId.label}"
                                      required="#{bindings.DepartmentsView1.hints.ManagerId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.ManagerId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.ManagerId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.ManagerId.tooltip}" id="it3">
                            <f:validator binding="#{row.bindings.ManagerId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.ManagerId.format}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.LocationId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.LocationId.label}" id="c4">
                        <af:inputText value="#{row.bindings.LocationId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.LocationId.label}"
                                      required="#{bindings.DepartmentsView1.hints.LocationId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.LocationId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.LocationId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.LocationId.tooltip}" id="it4">
                            <f:validator binding="#{row.bindings.LocationId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.LocationId.format}"/>
                        </af:inputText>
                    </af:column>
                </af:table>
            </af:form>
        </af:document>
    </f:view>The managed bean code is
    import javax.faces.event.ValueChangeEvent;
    public class ControlVisibilty {
        private boolean table;
        public ControlVisibilty() {
            setTable(false);
        public void onRadioSelected(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            if(valueChangeEvent.getNewValue().toString().equals("1"))
                setTable(true);
            else
                setTable(false);
        public void setTable(boolean table) {
            this.table = table;
        public boolean isTable() {
            return table;
    }

  • Calling a Jdialog from javascript using bean in JSP

    Hello all...
    In my jsp page , I have a button , onclicking it a javascript is called and in that javascript a bean is called to show a JDialog window. In that Jdialog window , I have a JTable, Accept button and Cancel Button..
    But the JavaScript is not calling bean...
    sample code :
    <input type ="submit" name="submit" onclick="func()">
    <script language ="javascript">
    func(){
    beanid.fn();
    </script>
    and in MyClass.fn(){
    codes for display is written......
    Is there anything wrong in this approach or if any other solution will to my needs please let me know..
    Regards
    SunilrKP

    Where is the JavaBean? Are you using an (J)Applet to deploy the bean to the client? If so then you might want to hop on over to the [Applet Forum|http://forums.sun.com/forum.jspa?forumID=421] to see what the problem is. When you do, show them the JavaScript you use to access the Applet.
    If you are not deploying the JavaBean via an Applet, then the class lives on the Server, while JavaScript lives on the Client - two different machines separated by space and time. You will need to change your approach (ie deploy the bean via an Applet or don't stop trying to use Swing as display over HTTP).

  • I have bought an used Iphone 5. I dont have the password for the existing login id of the old owner. How do i use the phone and change the log in id?

    I have bought an used Iphone 5. I dont have the password for the existing login id of the old owner. How do i use the phone and change the log in id?

    Unfortunatly the only way that you can get it off is to get the old user to input the password.  You may need to contact that old user and see if he can put the old password in.  hope this helps.

  • My sites have been hacked and hostgator has told me to "Disable javascript - Use the firefox addon noscript" and I don't know how to. Are all updates always sent to me as that was another point made to prevent hackers? Thanks you. David. in English

    What are malicious scripts and what causes them? Over the years hackers found it hard to trick people into visiting suspicious sites so they're now targeting legit sites and using them to infect unknowing customers. In most cases an FTP account's password is obtained through key logging malware, then legit website files are modified to distribute the malware and gather more passwords. If your PC has been infected with one of these trojans, your bank account, email accounts, and FTP accounts may no longer be secure. * What to do if you find malicious scripts 1. Use the following online vulnerability scanner and ensure your software is up-to-date: http://secunia.com/vulnerability_scanning/online/?task=load 2. Download antivirus and fully scan your PC for malicious files. Here are some free online scanners: http://housecall.trendmicro.com/ http://www.bitdefender.com/scan8/ie.html http://www.kaspersky.com/virusscanner http://support.f-secure.com/enu/home/ols.shtml 3. Update all passwords that may have been obtained. Do not use old passwords, generate new ones. 4. Upload older versions of the files or contact support for assistance removing the malicious scripts. * Prevention - Ensure you use the latest browser version - Disable javascript - Use the firefox addon noscript - Download and install some free antivirus software, make sure it stays updated - Use http://www.avg.com.au/index.cfm?section=avg&action=onlinescan to test suspicious links you are given in emails or find online. If you are seeing a Google Attack Page when you visit the site, use the steps below to request that Google reindex the site and hopefully remove this block. This excerpt was copied from the URL below, and provides step by step instructions to request a delisting. http://www.google.com/support/webmasters/bin/answer.py?answer=45432 Once you have reviewed your site and are sure it is clean, you can can submit a request for review. Note that you'll need to verify site ownership before you can request a site review. 1. Sign in to Webmaster Tools with your Google account. 2. On the Dashboard, select the site you want. 3. On the Overview page, click Request a review and follow the instructions. Best regards, Tyler Evans Network Security Administrator HostGator.com LLC http://support.hostgator.com

    Thank you.
    I also had tried other means of getting answers and got an even more specific answer on just how to do this.  Below is the link to the actual knowledgebase article giving specific instructions since there are some files that need to be on the Palm and some on the card, etc.
    http://support.laridian.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=380&ratingconfirm=...
    I emailed Zondervan to see if they might be able to direct me to a downloadable manual.  The referred me to laridan.com who now supports their software.
    I followed the instructions, taking into account some things that were already where they needed to be, hot synced it and it seems to be working fine with 7.8 M free space on my Palm which I trust is enough for my other very large applications.
    Thanks for your help!
    Post relates to: Tungsten E2

  • How can I change the password in the iBook donated to our nonprofit.  No password was given with the iBook?  We need to put in printer and other software.  Help, we can use the laptop without changing the password.

      How can we change the password in the iBook donated to our nonprofit?  No password was given with the iBook and every time we try to install items, the password window pops up.  We need to put in printer and other software.  Help! We can use the laptop without changing the password.

    If you did not get an OS X install-restore DVD with the computer you may need
    to buy one from somewhere, and you may be lucky to get a retail OS X 10.5.x
    version. The original grey-label install set of software and OS X it shipped with
    likely would be an older system than Leopard 10.5. Last versions of G4 Mac, &
    G5, shipped with a Tiger 10.4 system; so did early Intel-based Mac. Grey discs
    which accompanied other computer build models generally do not interchange.
    The last OS X version a PowerPC architecture can use, if supported, is 10.5.8.
    A PPC processor at 867MHz & faster should be able to run OS X 10.5 Leopard.
    {With the correct disc installer, you can use it to change a password and other
    things including re-install, and perform disk utility functions, etc.}
    There is a chance you may be able to get a white-label Replacement 10.4 DVD
    or Replacement 10.5 DVD from AppleCare or the online Apple Store (800myapple)
    from a Mac OS X system specialist; these have been available yet hard to get
    as not all persons involved with them seem to know if they still exist until someone
    is asking. These aren't retail stock, are special discs for computers who could use
    a system later than original old discs; these are complete install discs not for one
    specific series of Mac. Generally they'd work in supported PowerPC G4/G5; but
    do not replace specialized original install DVD, such as an early Intel mac requires.
    You'd need to have a serial number of the computer, and a method of payment
    when seeking some replacement system media from Applecare or Apple sales
    and these discs are not available in a retail store. The original Retail discs are
    labeled differently and shipped in a retail box with a big X on the front. Other
    sources for retail 10.4 Tiger or 10.5 Leopard may be online via amazon sellers
    or computer resellers who handle repaired Macs. Avoid mystery grey label ones
    that were intended to be sold and kept with their original computer kits.
    Good luck!

  • My Safari will not allow me to open my Google calendar with Google Apps. I have to open my email with the older version of Google Apps. This happened after I installed 5.1.4. I tried to use the fix of changing to 64 bit by unchecking the 32 bit box no go

    My Safari will not allow me to open my Google calendar with Google Apps. I have to open my email with the older version of Google Apps. This happened after I installed 5.1.4. I tried to use the fix of changing to 64 bit by unchecking the 32 bit box but that didnt help.

    I assume that there are legal restrictions on the way in which iTunes can get artwork automatically from any source apart from the iTunes Store (which is what the right-click > Get Album Artwork function uses).  For example, even though the Gracenote service that iTunes uses to match CDs and retrieve metadata (artist, album, track titles, etc.) also has artwork functions, iTunes does not make use of these.
    For manual addition of artwork, there are three cases where the image you select may not be correctly embedded in your media files:
    your media are in a format that doesn't accommodate embedded artwork - typically WAV files.  To embed artwork you'll need to convert to another format - Apple Lossless or AIFF if you want to preserve lossless quality, AAC or MP3 otherwise.
    your media files are read only - to fix this, use Windows Explorer to find the folder that contains your files, right-click and select Properties.  On the General tab there's a check box labeled "Read-only" - if this is checked, or is grey (sometimes blue), click the box so that the flag is unchecked and the box is white.  Click OK, and then OK again when the "Apply changes to this folder, subfolders and files" option selected.  Now try adding the artwork again.
    Windows permissions issues are preventing iTunes from updating your media files (there's some anecdotal evidence of a change in this behavior in iTunes 12).  See turingtest2's notes on Repair security permissions for iTunes for Windows for advice on fixing this, then try adding the artwork again.

  • How do I use pots on my client machine to change values, from the field, on my server machine and all other client machines?

    I am using Lookout 4.5, build 12, and I am having a problem concerning pots. I have data tables created for the different size sewer stations my system monitors. For each station, there are setpoints for starting and stopping of the pumps. I want to be able to change the setpoints for a station on the client file using a pot and have it change on all other machines running Lookout. I did this in 3.8 using DDE, but I don't want to use DDE anymore.
    I created a pot on the client file and URL'ed it to a pot on the server. On the server I created a table with a generic member "A" named "Lead Setp" and then created a member "A1" named
    "C5_1LeadSetp" then a member "A2" named "C3_1LeadSetp" and so on....
    In this table I connected the generic member "A" to the Pot I created on the server, and I connected A1 to its corresponding setpoint signal coming in from the field.
    On the client file I connected (in the table similar to the one on the server but with all signals for the station) the "A1" member to the setpoint signal coming in from the field, and I connected the "A" member to the Pot I created on the client file which is URL'ed to the pot on the server file.
    But, when I change the value of the pot on the client file, only the pot on the server and the "A" member in the table on the server change to the value of the pot on the client. The "A1" member whose screen I am changing the values from on the client does not change! This is the last thing I have to do and my file will be completely converted to 4.0. Does anyone have any ideas?
    Thanks for any responses..
    GBWY
    Jason
    Jason Phillips

    Hi Jason,
    If I understood your task correctly, you want to change the Setpoints on the Server DataTable using Pots from different clients. And also reflect these changes on the clients locally.
    You correctly remoted the Pots on the Clients to the corresponding Pots on the Server. However, you do not need tables on your clients. All you need is Expressions on each client to the particular cell of the Clients.
    So, to summarize: On the Server, the Pots write to the DataTable. And since the Pots on the Clients are remoted to these Pots on the Server, you can affect any change using these Pots. Because of the common remote source (Server Pots, i.e.) all of these Pots will always be in sync. Finally, to get the Setpoints on the Clients, just insert Expressio
    ns to the Server's DataTable.
    I am attaching a simple example (exmpl.zip) which does this. There are three processes -- My_Server, My_Client1, and My_Client2. I had them setup on the same machine so the paths are all process relative, but you can always change those to computer relative or absolute and move the client processes to diff machines.
    Hope this helps.
    Rgds,
    Khalid
    Attachments:
    exmpl.zip ‏12 KB

  • Purchased ipad already got apple id through itunes and iphone but it is not an email address ipad setup process will not allow me to use current id or change id to primary email address - do i have to have different id for ipad

    Purchased an ipad but already got apple id through itunes and iphone but is not an email address, ipad setup process will not allow me to use current id or change id to primary email address - do I have to have different id for ipad

    It does have to be a verifiable email address though, you can change it here:
    Apple ID support
    http://www.apple.com/support/appleid/

Maybe you are looking for