reset the number of subform based on the value of the selected drop-down list

Hello

I have a questions.  I have a form called request.  Inside of the application form, there is a subform called MultiForm, which is repeatable.  Application form has a drop down DropdownList1.  MultiForm has buttons 'Add profile' and 'delete profile '.

The form is the first launch, query appears with DropDownList1, MultiForm button "Add Profile".

That the user clicks on "Add Profile", a second MultiForm is insert.  On this second MultiForm, there is the 'Add Profile' button and 'delete profile '.

When the user change the value of the DropDownList1, I want the number of MultiForm reset so that it has only this MultiForm.  The 2nd, 3rd, etc., MultiForm is deleted.

Also, I want the "Add Profile" button to show only on the first MultiForm, not the subsequent MultiForm.

I came with the scripts below:

Remove MultiForm (added under the change event for DropDownList1.

function resetMyForm (myForm) {}

var vCount = myForm.count;

If (vCount > 1) {}

If (vCount == 3) {}

myForm.removeInstance (2);

myForm.removeInstance (1);

} ElseIf (vCount == 2) {}

myForm.removeInstance (1);

} else {}

do nothing

}

} else {}

do nothing

}

}

-The reason this function works for me because I'm only accommodate max 3 MultiForms to insert and there is always a MultiForm on the page.  I'm looking for a more "dynamic" script instead of the 'static' script above.  Any suggestions would be greatly appreciated.

Also, I have another question: I want the "Add Profile" to be present on the first MultiForm only.  As new MultiForm added, I don't want the "Add Profile" button to display on the subsequent MultiForm (with the exception of the first form)

Is there an example of a function that I can use?  Where should I insert this function?

Thank you very much for your help.

Hello

A quick fix would be the setInstances() method.

I'm surprised you found removeInstance() to work without calling instanceManager or trait shorthand (_) underscore.

_myForm.setInstances(0); // remove all instances
_myForm.setInstances(1); // create a new blank instance

Hope that helps,

Niall

Tags: Adobe LiveCycle

Similar Questions

  • Reading JSON file based on the selected drop-down list item

    I have little code shown below.

    I'm trying to read data from a JSON file based on certain criteria, in this case all the suburbs on a territory

    I can do that quite easily in a liquid hard coding the territory, however, I want to use the value of the < select > option

    I understand that this can be achieved with JavaScript, is it possible otherwise?

    < select id = 'territory' >

    < option value = "xx" >--please select--< / option >

    < option value = "CBD" > CBD < / option >

    < option value = "North" > North < / option >

    < option value = "South" > South < / option >

    < / select >

    {model module_json json="/_System/shipping/shipping.json" = "" = "shipping" collection "}

    < select id = "suburbs" >

    < option value = "xx" >--please select--< / option >

    {% for section in shipping.territory %}

    {% If the element.} TERRITORY is '< value on top of select >' %}

    < option value = "{{point." POSTAL CODE}} "> {{point." SUBURBS}} < / option >

    {% endif %}

    {% endfor %}

    < / select >

    Hi Craig,.

    You can skip liquid altogether and use JS to get the values you need for json.

    If you want to use liquid you need to load the last part with AJAX/XHR to enter the selected value.

    1. create a new file suburb.html and ajax request after #territory selected with the option as a parameter:

    URL: suburb.html? = north shipping

    2. the suburb.html file would be:

    {assign = globals.get.shipping-% selectedTerritory %}<- this="" will="" have="">

    {model module_json json="/_System/shipping/shipping.json" = "" = "shipping" collection "}

  • second drop-down list based on the first drop-down list Jdev 11.5 of loading

    Hi all

    I have a requirement of the second dropdown on the first loading selection drop-down list.

    Ex:-con I drop down state list, when I select and national, it must load city States (dropdown).

    I tried to use valuchange Stanley with partial trigger, that it did not work. Any help would be a great help.

    Please let me know.

    Thank you
    Nitin

    Published by: 811407 on December 21, 2011 02:59

    Published by: 811407 on December 21, 2011 02:59

    http://www.YouTube.com/watch?v=nXwL2_RP7AQ.

    you for example: here goes.
    http://www.YouTube.com/watch?v=94PrwXWDEjI

    http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-Oracle-ADF-11g-update.html

  • If Google is my default search, can I go and change it if I want to do a search for GMaps; only the default is in the search drop-down list.

    If Google is my default search, can I go and change it if I want to do a search for GMaps; only the default is in the search drop-down list.
    So I have to change the default to Google Maps then back to Google to search for one.

    I have it! It's the topic: config "hiddenoneoffs" where the 3 elements of google, maps and mcafee have been included. There was no space between Google and maps. I put one in from Google Maps. She appeared in the first box-ff, but not sure about the search in the second time zone. I went back to the subject: one-offs. Safe search was shown with a space after Secure. I took out the space. Safe search arose in the 2nd single search box!
    Weird! This is contrary to how they show in the search parameters.
    Can I have messed that when Firefox has been reset all the search engines on an update, but I do not.
    Either incidentally, I tried to re-installation characteristic but the file comes down as a .dmg that I'm not familiar with and don't apparently is 8.0 to win because he couldn't open it. Thank you once again.

  • The firefox drop-down list in the upper left corner is missing

    I do not have the firefox drop-down list box in the upper left corner.

    View > toolbars = uncheck the Menu bar

  • How to remove the old google browser displays the start menu in the internet drop-down list box?

    Original title: Start menu

    When I go to the taskbar and start menu properties I go in Start menu, and then click Customize. then at the bottom where it says see the start menu in the box, it shows an old browser I don't have how to remove it is the browser drop-down list internet google ch

    Hi OliveBrook,

    You can try to uninstall entries of Google chrome under programs and features and check if it appears in the start option of Internet link menu.

    See the link below to uninstall a program.

    http://Windows.Microsoft.com/en-us/Windows-Vista/uninstall-or-change-a-program

    Hope this information is useful.

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

  • Data from the field drop-down list does not clear when the reset button is activated

    Acrobat Pro XI

    All field boxes are checked in the tab properties of the button actions... but when I click on the reset button of the form I created only the data in clear text fields, not any of the data that has been selected in a drop-down list.  What I am doing wrong?

    The 'rest shape' command returns the fields to their default values. If this

    value is not empty, that's what he'll be back.

  • How to use a function switch box to the reference that is used several times in the previous drop-down list options?

    I use JavaScript coding in LiveCycle and development of dependent drop-down areas, but I find it difficult to write correct code. See the example below. I'm trying to use a multiple box function that refers to an option that is listed several times in the previous pull-down menu. The problem I am running into is that when I refer to any color or Nissan and Chevy, it returns the results of the color in the "Ford" column only. I'll always see color (blue, black, green and purple) options in my second drop-down list and it seems fine, but then the third drop reference only the options and colors 'Ford '. (I don't have the code for the third menu list drop-down).

    I want the client to choose Chevy or Nissan and have her drop downs (based on the color they chose)-dependent, but I can't seem to make this work.

    I hope it is clear enough (probably as mud...). I would appreciate help!

    Form1. #subform [0]. #subform [1]. cboModels::exit - (JavaScript, client)

    cboColor.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case 'Chevy ':

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case "Nissan":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    }

    Form1. #subform [0]. #subform [1]. cboColor::exit - (JavaScript, client)

    cboPrice.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case 'Chevy ':

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case "Nissan":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    }

    You can use '\n' for newline in a string, so

    "Option 1, \nOption 2, \nOption 3;

    Put each on its own line.

    Bruce

  • expand the category drop-down list table in the model of checkbook

    Using version 2.3 of numbers 09.  Try to understand the model section for checkbook and to expand the available categories in the menu drop-down allows to assign a category to an entry in the checkbook.  Where would we go to learn this procedure.

    Hi Robert,.

    This is as good one place as any.

    If you have started using the model and have defined categories for all operations, make changes to the cells in these rows. Fill the pop-up menu edited cells wil also reset the value of each cell filled to the currently selected value in the source cell to this filling.

    Add new categories to a cell in the context menu

    In the Transactions table, click any cell to the row and column reference tabs appear.

    Line control grip (red arrow in the image below) and drag to the bottom to add a new line. The new line will contain a new copy of the cell from the popup menu in the category column. Click this cell to select it.

    In the bar of buttons above the workspace, click the Inspector button to open the Inspector, and then click the format cell [42] button to go to the cell format Inspector.

    You will see the list of the menu items for the selected cell. The list below are a pair of buttons marked + and - (blue arrow). To add a new item to the menu, click on the button +.

    The new item appears at the bottom it has the list, with its highlighted text as shown. Type the new category name.

    Repeat for as many new features that you need.

    You can also edit the items already in the list.

    Double-click an existing item to select the text. Type the new name for the item.

    When you are finished, close the Inspector.

    The menu changes are applied immediately and affect only the menu in the modified cell, and cells, this version of the menu is filled in. If you add a new line to the bottom of the table, for example, the edition menu of line 15 will be filled in the new line.

    Add a new category to the account categories table

    The new category is not automatically added to the category table account. When you add it, ensure that there is an exact match between the label of the table and the category in the menu.

    Click any cell in the account categories table to select it.

    Enter the line control handle and drag down to add as many lines as necessary.

    Note that the totals in a footer line moves down and the new lines are added above it.

    Fill in the new lines of the new category (or categories). *

    If you have completed transactions for these categories, these will be totaled in the B column and adds the total in the footer line, but not yet appear on the pie chart.

    Add the new categories on the pie chart

    Click the pie chart to select it and show its data source.

    Data for the graph comes from the cells defined by the selection (in blue) rectangle. The cells shown in white on a background come from the chart legend labels black in column A of the table in the colors of the wedge can be seen in the box beside the category name (and can be changed by clicking on the box, and then choosing a new color in the fill color in the toolbar).

    To add the new category to the table, place the mouse pointer on the small handful (circle in the lower right corner of the selection rectangle. When the pointer changes into a Black plus sign, click and drag down to lock the new categories, which will be instantly assigned a color and added to the graph.

    Click anywhere outside the objects onscreen to deselect all objects, and then save your work.

    * To ensure matched spelling between the menus and the list of categories, select one of the new cells of menu and copy. Select one (or all) cells new category on the table of the types of accounts and paste. Specify each menu to the new categories, and then select all the cells in the new category. In the format of cell Inspector, use the context menu to change the format of these cells to the text. This removes the attribute from popup menu of the cells, leave the text as it was when the last value.

    Kind regards

    Barry

  • How to make the menu drop-down list with a scroll bar

    Hello

    I have a drop-down list that is filled with different table sizes.

    I have a size of 30-element array.  Some of the last items just go off the screen at the bottom of the Simulator PB.

    Is it possible for me to add a drop-down scroll bar?

    DP = new DropDown();
    dp.rowHeight = 24;
    DP.prompt = "stuff";
    DP. Height = 34;
    DP.width = 230;
    DP.x = TitleTB.x + 170;
    DP.y = Title.y-3;
    addChild (dp);

    Some of the tables look like this-

    case 'List 1':
    dp.rowCount = 2;
    for (var i: int = 0; i<2;>
    {
    if(i==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"blahblah"});)
    }
    else if (i == 1) {}
    DPP.unshift({label:"foofoo"});)
    }
    }
    dp.dataProvider = new DataProvider (dpp);
    addChild (dp);
    break;

    case "List2":
    dp.rowCount = 30;
    for (var n: int = 0; n<30;>
    {
    if(n==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"lalalala"});)
    }
    Else if (n == 1) {}

    **********

    Delete the existing table using splice (0);

    then I add the new array of labels.

    Before, when I didn't have the splice (0), I only had the .unshift () and sometimes got bays combined together and a scroll bar appears automatically in the Simulator.  But then the berries were mixed.

    Thanks for the help!

    Hey mlin13,

    from the looks of it, your property rowCount is set too high. the rowCount property represents the number of lines displayed on the screen when the drop down menu is open. so if the number of rows is less than the amount of items on the list, it will create a scroll bar with a drop-down list for you. try to set the number of lines to a default value of 10 and and keep it manipulate your list from there. and see if you get the desired results. Good luck!

  • How to replace elements of the menu drop-down list

    Hello

    I have a drop down menu where I have disabled the custom text entry. the last item in the drop-down list is the option 'Other' where I want the user to write additional details. I was wondering if there is a way to bring up a text field when "Other" is selected.

    In addition, the drop-down list field extends all the way through the page... then when the option 'Other' is selected, would it be possible to automatically reduce the field to adapt to a text field next to it for the user to enter details.

    I don't know if there is a better way to do... any help would be very appreciated!

    Thank you!!

    Hello

    I hope you get it working soon.

    I suspect that the form is not saved as dynamic:

    Other than that, be sure that the references object in script matches objects in forms, including subforms if objects are in different subforms.

    If you could share the problem it would be useful to find the problem.

    Niall

  • How to: Disable the new 'Visit what you type' in the url drop-down list. FF 43

    So with the update of FF 43 Mozilla is still destroying my workflow. While browsing I have I'll especially out of muscle memory. And the new updated through upward in the top position most of the url drop-down the search with the option. I disabled that within 5 minutes but now instead of it's me give "visit"url what ever I can partially be hit". I wish that this new item disabled and can't seem to find an option for her.

    I never understood why the url bar allowed for searching the Web when there is already a dedicated search bar.

    You can set this pref to false on the topic: config page.

    • Browser.urlbar.unifiedcomplete = false

    You can open the topic: config page via the address bar.
    You can accept the warning and click on "I'll be careful" to continue.

    Location drop-down menu bar may show items from the history, as well as pages of a bookmark and sites currently open in tabs.
    You can define what suggestions to show when you enter a URL in the address bar in "Options/Preferences > privacy".

    • Tools > Options > privacy > address bar: when you use the location bar, suggest:
      History
      Bookmarks
      Open tabs
    • choice of browser.urlbar.suggest.history.onlyTyped must be modified directly through the pref
    • choice of browser.urlbar.Suggest.Searches is present in Firefox 43 + as 'See the search in the location bar results suggestions' in "Options/Preferences > Search" in the search parameters
  • in the 'history' drop-down list, there is an option to "restore the previous session. I want to remove this option completely.

    I speak no crashes or my home page. I'm talking about the option in the history drop-down that allows anyone who comes behind me to restore my session, after I'm gone.

    COR - el, I read several threads with this question, and you always seem to post these links. I don't think you understand the question properly. I read the first link you posted, and the most relevant element has been 'store session completely disabling. so I went in: config, and did what I was told. I set the preferences browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo to 0. it does not work. After that, I close firefox and reopen. in the drop-down list in the history, there's always an option to restore previous session, I click on it and it restores session.

    Diego, your response is not what I was hoping. I want to stay signed in the pages I frequent. like gmail, youtube, ect. your solution sign me out of everything every time. Thus, although technically it works, this is not the option I want to use. but after tinkering with the options in this section I figured it for everyone with my same worries:

    go to: Tools > options > privacy, in the 'history' pane, select 'clear history of firefox closing', click on settings for this option, select "Browse and download history.

  • Tabs aren't appearing online with the Firefox drop-down list button.

    Here is a screenshot of the problem: http://i.imgur.com/y2binxI.png

    The tab bar is not the tail with the drop-down list button, and nothing I've tried yet fixed.

    Things I've tried:

    - Un-maximising and re-maximising the window (this has worked in the past when I have this problem, but not this time)
    - Moving things around in the Customize screen to see if something got moved out of place
    - Restarting with add-ons disabled
    - Checking for any toolbars to hide/unhide
    

    I have not yet tried to do a full uninstall/reinstall again because, well, that would be a little pain.

    Any suggestions?

    You run Firefox with an enlarged screen?

    You can set the Boolean pref browser.tabs.drawInTitlebar true on the topic: config page to see if that helps.

Maybe you are looking for

  • to install on another computer and don't remember pw

    Don't know pw, that he will not, except the one I thought I had on another computer. How can I reset pw

  • How to type 1/2 characters in El Capitan?

    Please update "how to type the symbol for 1/2". Last reply: October 21, 2014 18:19 by westongallagher is now deprecated as El Capitan does not have 'Special characters' under the 'Edition', only 'Emoji & symbols"menu that does not include fractions.

  • HP Pavilion 8750: PCI Wireless card

    In fact, the operating system is Windows Millennium Edition. am I right that there is no compatible with this machine wireless card?

  • Backward compatibility of games in an Xbox

    * Original title: backward compatibility Is it possible to ask the people at Microsoft to add games to an Xbox backward compatibility? I really miss playing Skyrim, Oblivion, Far Cry 3 and many other games. Thank you

  • I have a set of software for Windows Server 2008 with SP1 32-bit?

    My office is running: Windows Server 2008 with Service Pack 1 32-bit. AMD Athlon II 640 (Quad Core) 3.2 Ghz Installed memory: 3 GB RAM DDR2 1 Gb integrated graphics. NOW!. My motherboard: DKA 790GX Platinum. Micro Star International. My hardware and