New to LiveCycle, and am looking for a way to have a dropdown box only display data based on the entry in another dropdown box. For example if I have a State Dropdown, that list's all the States and then a City Dropdown that would only List City's within the State selected in the State Dropdown.
I "kinda" get what you mean, but I don't know enough about naming of Script Objects, fields and using the addItem function to know how they link together - think dumber for me!! I understand how to have the different countries and states being input into an array, but where does the "array" fit into it? I have looked at the scripts in the Purchase order form, and they say:
'countryScript.getCountries(this);' but I don't know where or what 'this' is. The other thing is, I don't know the definition in this sense of what 'hard code' is. I thought I did, but apparently not.
I feel like I'm almost getting it, but sorry, not quite there yet. Could I ask for a little more help?
Thanks to both of you so far.
Hi Mj Harvey,
In Script objects you can define your general scripts of your form and functions. You can right click of the form in the hierarchy palete and clicking "Insert Script Object" will create a new script object with blank name. This object will be under the "Variables" in the hierachy. You can rename this object by F2 to your desired (as myScriptObject).
When you click on the script object on the hierachy, in the script panel you can define your arrays and functions. Define an double sized array as stateArr (as in Purchase Order). After define the same function stateOrder as in Purchase order.
In the dropdown change event, in script panel: you can call this function as myScriptObject.stateOrder(....) as in Purchase order. If you could not achive you can send me email firstname.lastname@example.org.
I need to do something slightly similar.
I have two drop-downs for a hotel reservation-type application. The first is for the check-in date, the second for check-out date. If check-in is input first, check-out must have a later date and vice versa.
How about if I want to achieve the same effect but with integers rather than dates? For example, two drop-down boxes with values from 0-9 - the second drop-down cannot contain a value less than the first drop-down.
That is easier that the previous means as you can get the DropDown.rawValue property and compare it to the 2nd one ....a much easier set of commands.
i have a pull down menu and 2 other pull down menus hidden. When a choice is chosen from the first menu I would like one of the other ones to appear. Can someone help me out with a statement I can do this with. I think Its an If statement I'm looking for.
1st menu only has 2 items in the menu.
I got it to work with a radio button useing the click feature:
Subform4.presence = "hidden";
Subform3.presence = "visible"
I really want the pull down menu instead of the radiobutton.
Please help, thanks Lucy
Thanks for the recommendation to use the Purchase Order sample -- the script object worked well for my application. However, there is one problem with this script. If you select "Canada" as the country and "British Columbia" as the state/province, and then change the country to "United States", "British Columbia" remains in the state/province field unless you reselect a state. This means a non-permitted country/state combination can be retained in the form.
Do you have a fix that clears the state field when the country field is changed and then populates the drop down with the appropriate states? Thanks for your help.
You can make state combobox empty in the change event of country combobox. In the change event check the previous value with changed value, and if they are not equal, make state combobox empty.
If you need the script solution as well, you can mail me.