How to enable/disable readonly in text fields, drop-down list field?

For example, I have a dropdown field named "DropdownField" and a field of text called 'TextField '.

Within 'DropdownField', I have four choices: Option 1, Option 2, another, combination. When the user first sees the "DropdownField", they see 'Select Option.' When the "DropdownField' select Option, Option 1 or Option 2 selected, I want to 'TextField' to be a read only field. However, what other or combination are selected, I want them to be able to grasp things in the 'TextField', which makes is not readonly. Also, tell someone selects 'Other', but realizes that they have made a mistake, I want them to be able to select Option 1, and have the return of 'TextField' read-only.

Currently I have the JavaScript code as a MouseUp on "DropdownField: action

var getField.DropdownField = drop;

var getField.TextField = text;

If (drop.value! = 'Other' | drop.value! = 'Combination')

{text.readonly = false ;}

on the other

If(drop.value = 'Other' | drop.value = 'Mix')

{text.readonly = true ;}

However, the JavaScript code above doesn't seem to work. Please let me know what I'm doing wrong!

You must use the event to validate drop-down list and use a script like:

var f = getField("TextField");

if (event.value === "Other" || event.value === "Combination") {
  f.readonly = false;
} else {
  f.readonly = true;
  f.value = f.defaultValue;
}

Also, set the option in the drop-down list "Value Commit selected immediately".

Tags: Acrobat

Similar Questions

  • How can we change the visibility of the drop-down list after its creation?

    I create a QML document with three drop-down lists.  Depending on how "trans_type" is selected, only to drop Extra should be displayed.  If the option "account" is selected, the drop-down list is visible and the DD category is hidden.  The reverse is true if the 'category' option is selected.

    Here's how I build my QML document:

    void Testing::updateFields()
    {
        if (m_form.isNull())
            return;
    
        // Clear all fields from the form
        m_form->removeAll();
    
        // Clear the internal mapping
        m_fields.clear();
    
        //get the transaction page ready
        QmlDocument *qml = QmlDocument::create("asset:///transaction.qml").parent(this);
    
        DropDown* trans_type = qml->createRootObject();
        trans_type = DropDown::create().title("Transaction Type");
        trans_type->add(Option::create().text("Accounts").value("0"));
        trans_type->add(Option::create().text("Categories").value("1"));
        trans_type->setSelectedIndex(0);
        connect(trans_type, SIGNAL(selectedIndexChanged (int)), this, SLOT(onDDChange(int)));
        m_form->add(trans_type);
    
        DropDown* account_dd = qml->createRootObject();
        account_dd = DropDown::create().title("Account");
        account_dd->add(Option::create().text("No Account").value("0"));
        //... code to populate account drop down here...
        account_dd->setSelectedIndex(0);
        m_form->add(account_dd);
    
        DropDown* category_dd = qml->createRootObject();
        category_dd = DropDown::create().title("Category").visible(false);
        category_dd->add(Option::create().text("No Category").value("0"));
        //... code to populate category drop down here...
        category_dd->setSelectedIndex(0);
        m_form->add(category_dd);
    
    }
    

    Everything is displayed properly on the page.  onDDChange is called and it shows a Toast that the option has been selected.  Here is what I currently have in onDDChange:

    void Testing::onDDChange(const int &info)
    {
        QString msg = "Switched To: ";
        if(info == 0) {
            msg = msg + "Account";
        } else if(info==1) {
            msg = msg + "Category";
        } else {
            msg = msg + "Unrecognized";
        }
        showToast(msg);
    }
    

    I can't figure out how to get the drop down lists to be visible/hidden depending on the needs.  There is a function "setVisible()" for the drop, but I can not understand how to operate without the app crashing.  http://developer.BlackBerry.com/Cascades/reference/bb__cascades__dropdown.html#function-setVisible-v...

    My questions are:

    1. How can I change the visibility of the appropriate dropdown lists in a different function when the status of the main drop-down list is changed?

    2. is there a way to define an id for drop-down lists?  If not, how am I supposed to go into the drop-down lists in a variable later so I can receive their value or change the visibility?

    Any help would be great.  I've been struggling with this for a while.

    There are a number of methods you could use signals and slots between your code and the QML or something simple is assign "objectName" as a property, then this search in C++.

    http://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/

    Something like

    DropBox db = mRootContainer->findChild("dropboxname");
    db->setVisible(true);
    
  • How to create the link between the two drop-down lists

    Hi all

    I've created a form in which there are two drop-down lists.

    Let's say a drop-down list contains three elements A, B, C

    and another drop-down list contains three elements, Apple, banana and cherry.

    So, my request is how to create a relationship between these two drop-down lists, so that if I choose 'A' in the 1st drop-down list, Apple will be selected automatically in the 2nd drop-down list.

    Thank you

    Stéphane

    Hi Scott,.

    Niall is great. You can also use a hidden field to update the second drop-down list value.

    The first drop-down list change event script.

    Select var = xfa.event.change;
    var Items = List1.resolveNode("#items[0]").nodes;
    for (var i = 0; i)
    {
    if(Select == items.) Item (i) .value)
    {
    break;
    }
    }

    If (List1.Length > 1)

    {

    var Items_List2 = SecondDropdownlist.resolveNode("#items[0]").nodes;
    HiddenTextField.rawValue = Items_List2.item (i) .value;
    SecondDropdownlist.rawValue = HiddenTextField.rawValue;

    }

    Thank you

    Sidonie.

  • send several ID field of unique text through drop-down lists

    Hello

    It drives me crazy.

    I have x 3 drop-down menus 'Day' "Month" "Year" and I want to send these parts to a single rating marked with the id 'date' to compensate for a syntax correct date without refreshing or send the form. I use getelementbyid to send the onchange = "getAmount (this.id) request for drop-down list", but it sends only an id and when the next drop-down list is selected it replaces the previous selection, rather than putting all of this together in correct date format. "

    Here is the code I use, but it is clearly wrong: -.

    Each drop-down list: -.

    getAmount (this.id)

    and then the following javascript code to send the ID

    < script type = "text/javascript" >

    function getAmount (optText)

    {

    var salt = document.getElementById (optText);

    document.getElementById("date","['EventDayID_<?php_echo_$cnt1;_?>','EventMonthID_<?php_echo_$cnt1;_?>','EventYearID_<?php_echo_$cnt1;_?>']").value = sel.getElementsByTagName ("option") [sel.selectedIndex] .innerHTML;

    }

    < /script >

    and the input field I want to enter the full date: -.

    < input type = "text" name = "" id = "date" / >

    Is anyine knows how to handle this?

    Thank you very much

    Glennyboy

    You only need one identifying any...

    Change your Mysql in bulk or add check boxes used or unused:

    SELECT * FROM table WHERE IS NULL or IS NOT NULL column

    You can extend your

    SELECT * FROM table WHERE column1 = something AND column2 IS NOT NULL

    or

    you check every box before printing it, if (cb1! = "" or cb1 == "") {echo/print/do something ;}

    Thank you

    J

  • How to remove the filter of the table drop-down list

    Hello

    Jdev: 12.1.3

    I have a table of readonly in my page. On the one hand of the column, I've defined LOV (VO attribute is ID and name will appear in the LOV) in the VO. So in the filter of the Table, he comes as a drop-down list. How can I change this drop-down list for the field of plain text.

    When the user types text in the search field and press ENTER, it must filter the table with the name you entered.

    1.JPG

    See you soon

    AJ

    Johny

    I made a few changes in your application, added a transitional and populated with lov accessor and applied the filter on departmentid of this transitional

    Check it out, in the same way, that you can do for other attributes

    In fact I think that it is the default when you apply lov on certain attribute and then filter works in this way, or you enter the string full or just the value of the id

    Ashish

  • How to choose a specific value in a drop-down list using javascript

    Hello

    I'm looking for a way to select a specific value in a drop-down list (the first value) using javascript? How would I do that? Thank you in advance.

    Here's how you can select the first item without having to know what it is:

    Set the value of the drop-down list to the first element cb1

    var f = getField ("cb1");

    var val = f.getItemAt (0, true);

    If (val) f.value = val;

    Change 0 to a different index if desired, or use-1 for the last item in the list. More information for the field getItemAt method is in the Acrobat JavaScript documentation.

  • Show / hide the text box drop-down list database

    Hi all

    First time post here - wahoo!  :-)  Brand new user of LiveCycle, and so far I'm loving - very cool app!  I am a bit puzzled, however, and hoping someone can help...

    I am using LiveCycle version 8.05 and try to build a form that has a drop-down list with departments in our Organization.  If the user selects the elements 1-5 on my list, I want two other fields at autopopulated (one for the Admin Assistant) and one for Dept Head.  If however the user selects 'Other', I want a text box (it will be hidden the rest of the time) where the person will be able to type in the Department they work for.  For now, I'm only interested on getting the box 'Other' to appear; I'll worry about the other stuff later.

    Elsewhere in my form, I have a functioning drop-down list that displays a text based on the selection field; However, for some reason this logic does not work with the situation described above.

    My code for the working text field is (in JavaScript)

    var
    
    (sNewSel)
    case "1": 
    switch
    {
    
         TextField6.rawValue = "My text is in here";
    break;
    case "2":
    
    
    
    = "My second text is in here ";
    
    
    break;
    "3":
    
    case 
    
    = "My third text is in here.";
    break;
    TextField6.rawValue
    
    default:
    }
    break;
    
    
    TextField6.rawValue 
    
    
    sNewSel = this.boundItem(xfa.event.newText);
    

    After many fruitless hours yesterday, I got only to the extent where the code below; This was more or less copied right out of a post here.  When I click on the drop-down list, select 'Other', the text field is displayed.  I tried the definition of the text field to the times 'Hidden' and 'Visible' through properties of the object, but no luck.  I tried to use IF statements, subforms and anything else I could think of but am getting nowhere.

    var nSubLength = Subform1.nodes.length;
    var 
    sSelectField 
    for
    
    {if
    {switch (xfa.event.newText) 
    (case "6":
    Subform1.nodes.item(nCount).presence
    break
    default:
    Subform1.nodes.item(nCount).presence
    break
    }
    }
    }
    ;
    = "invisible";;= "visible";((Subform1.nodes.item(nCount).className == 
    "field") &(Subform1.nodes.item(nCount).name== sSelectField)) 
    (var nCount = 0; 
    nCount < nSubLength; 
    nCount++) sSelectField = fieldList.rawValue;
    = sSelectField.replace(' ', '');

    Any ideas?  This is very new to me, but I am familiar with other programming languages, and something this simple should not be difficult which leads me to think I'm missing something.

    Thanks in advance

    Chris

    It was easier to create a sample for you... Please see the attachment.  I think that's what you want.

    The code is on the change event of the DDList

    Paul

  • How can I change the order in the drop-down list the address bar?

    I like Firefox, but one thing I want to change is the behavior of the address bar drop-down list - where it shows the previous sites I visited. I'm looking for a way to list of these in chronological order - so the most recently visited site is at the top. know how it is in IE!

    Is this possible? I'm happy to go in and change settings or install any addons that I need to do.

    Hello zeel, this article explains how the sorting mechanism in the firefox url bar: https://developer.mozilla.org/en-US/docs/The_Places_frecency_algorithm

    Although there are some settings to adjust the table available when you go to Subject: config I don't think it's possible to achieve your goal exactly using the built - in firefox. You can set the preferences (increase) of the value of the . places.frecency * BucketWeight while to increase the rank of the most recent visits and adjust the timespan in days for different buckets through the . places.frecency * BucketCutoff...

  • How to add a destination folder in the drop-down list box "send to" in Windows XP?

    One of my disks in CD does not work, so I want to add the DVD drive in the drop-down list box... I can't remember how.

    Hello

    This article can help...

    http://support.Microsoft.com/kb/310270

    Tricky

  • How to dynamically add an Option in the drop-down list?

    I have this code:

    {Drop-down list

    ID: list

    Title: 'list '.

    onCreationCompleted: {}

    opion var = new Option();

    opion. Text = "Hello";
    opion. Value = 4;

    List.Add (opion);

    }

    }

    After the launch of the application, the list is empty.

    Why my code does not work?

    It is easy to dynamically add options

    first add this to your attachedObjects:

    ComponentDefinition {
                id: optionDefinition
                Option {
                }
            }
    

    then do something like this

    var newOption = optionDefinition.createObject()
                newOption.text = ...
                newOption.value = ...
                newOption.description = ...
                newOption.selected = ....
                yourDropDown.add(newOption)
    
  • How to pre-select an item in a drop-down list

    Hello

    I need to pre-select an item in a drop-down list, but I don't see how to achieve this using the current or existing methods.  I know that if I set the rawValue then it works, but later when I try to retrieve the data in the selected drop-down list the order of the day list, I get an 'empty' which does not help.  What he needs, is the value, the pair of label to work properly. When I manually select an item in the drop-down list, it works perfectly. But not when I try programtically set. So now I wonder if it is possible to set the index for the drop-down menu, so that he believes have a selected item, when I survey I get the correct value.

    Hope you can help.

    Kind regards

    Ian

    Hello

    You can use the selectedIndex property to set the desired value.

    And to retrieve a value, I recommend you to use *.getDisplayItem (*.selectedIndex);

    I hope this will help you!

  • How to fill out the database in the drop-down list box

    Hi all, I want to display all the data in database (c_type) column in the drop-down list box, how can I do?

    I use form 6i.

    Sorry if the question is already exist in the forum...

    Kind regards

    Maybe this helps http://andreas.weiden.orcl.over-blog.de/article-28957008.html

  • How to fill a textfield based on a drop-down list and a checkbox control

    Hi guys,.

    I need help.
    first step: I have a drop down list, if I click in the dropdownlist control 'a' and place it in the digital field a number greater than 99, checkbox must be marked and second step: a textfield1 must be visible.

    the first stage works perfectly, but the second does not.
    This is my code for the second stage of the event: java script of change of

    If ((DropDownList1.rawValue == "a") & & (this.rawValue == 1))
    {
    TextField1.presence = "visible";
    }
    on the other
    TextField1.presence = 'hidden ';


    everyone has no idea why?

    Thank you!!

    Diana

    Hi Diana,

    You are on the right track. deleteItem is zero base; so if you want to remove the second point, it would be deleteItem (1).

    I would recommend a script similar to the output from the drop-down list, so that if the user goes back and changes the value, the same logic would apply. Also when you remove items from a drop-down list by using script, it is useful to addItem() again in the other part of the if statement. In this way, you can restore the list because the shape is changed.

    Also I would wrap the script in the numberField in another State to check for null first.

    Attached example.

    Good luck

    Niall

  • How to influence the APEX 4.0 autocomplete text element drop-down list colors?

    Hello

    Could some body if you please tell me the model that I need to change?

    I use the 15 theme and the text with AutoComplete element has a very different color scheme, I would like to change, so that it would harmonize with the theme 15 colors. It's just that I can't find the model to change. TIA.

    Tamás

    Tamas

    There is no model for the AutoComplete element. His appearance is controlled entirely using CSS. Theme 15 includes a style on the theme of AutoComplete items: she descends to a generic schema that is specified in the apex_4_0.css style sheet:

    .ac_results {
      padding: 0;
      border: 1px solid black;
      background-color: white;
      overflow: hidden;
      z-index: 99999;
    }
    .ac_results ul {
      width: 100%;
      list-style-position: outside;
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .ac_results li {
      margin: 0;
      padding: 2px 5px;
      cursor: default;
      display: block;
      font: menu;
      font-size: 12px;
      line-height: 16px;
      overflow: hidden;
    }
    .ac_results li {
      margin: 0;
      padding: 2px 5px;
      cursor: default;
      display: block;
      font: menu;
      font-size: 12px;
      line-height: 16px;
      overflow: hidden;
    }
    .ac_loading {
      background: white url('indicator.gif') right center no-repeat;
    }
    .ac_odd {
      background-color: #eee;
    }
    .ac_over {
      background-color: #0A246A;
      color: white;
    }
    

    The best approach would be to use a tool to identify what web Inspector that each of these rules in the context of the use of the AutoComplete element and create your own theme-15-friendly style sheet to override this subset of apex_4_0.css.

  • How can I change the content of the drop-down list window which shows after JUST click the button START

    The window appears after using the right click on the mouse. Before I had a Tech. remove a Trojan visuses the window showed just find, Explorer, Delete, now it showes such articles that take control, Google, download of virus total.etc.  So, how can I get rid of items that I don't want?

    The menu that appears when you right-click is called the "context menu", and various third-party applications can install entries here.  You have several choices regarding the removal of these entries:

    1. If you can determine what application is involved, you can see if the application has a configuration or menu options enabling to customize what appears in the context menu.

    2. If you can determine what application is involved and that you no longer want or need this app, you can uninstall it.  Praseetha K is close, but no cigar gets.  Virus Total is an online service that checks uploaded for viruses, files.  Virus Total also offers a "upload" allowing you to download suspicious files by right-clicking (see http://www.virustotal.com/advanced.html).  You can decide if you want. If this is not the case, simply uninstall it.

    3. If you are unable to determine what application is involved, or you want to keep the application but it does not offer a configuration without the context menu item, download ShellExView and you will probably be able to go to the bottom of things pretty quickly.

Maybe you are looking for

  • Touchpad not working not for a few seconds after I touch it with your finger, then a more...

    I already tried SMC and reset the PRAM, but who doesn't. I found someone with such a similar problem (Trackpad doesn't work sometimes on MBP after upgrade OS X 10.8.2) but the measures that seem to work for them do not work for me. Thus, as described

  • Is there a way to manage my itunes library and playlists in a spreadsheet format?

    ITunes assigns each song on compilation cd of for a separate album title, how can I fix it?  Y at - it an option for the management of playlists and library in a spreadsheet format?

  • On the network and security in Pakistan

    is there a guarantee of Lenovo Smartphones in Pakistan? and its 3G and 4G will work in pakistan or not? Please help me I wana buy this product Lenovo K3.plzz response Comment to Moderator: Please refrain from bumping your threads / post (s) more freq

  • Filter KeyDown event does not.

    The attached file includes a sub - vi (drop-down) with his code wrapper isolated from the rest of the program and used as the main vi (drop Ring). I currently have three ways to "exit" from the menu drop-down; both labour and the other does not. Who

  • Compatibility of Red Faction G-war

    Original title: compatibility Im trying to get a game to work from steam (g-red faction war) I click on the game so he could start working everything seems fine at first, it is said from the game and turns the hourglass then it just stops and nothing