How to populate a field depending on TWO drop down menu entries?
- April 19, 2023
- 1 reply
- 3140 views
Hello everyone,
I'm quite new to using javascript on Acrobat, and I'm running into the following issue:
I have a form that would return a specific value depending on what's been selected in two drop down menus.
The first drop down menu shows a list of aircrafts which have two power settings (and the two power settings are set on the second drop down menu)... So first dropdown shows the aircraft registration, the second will show what power setting is being used (ie, max range, or max speed). Each power setting will use two different fuel flows. And the fuel flow is what I would like to populate the cells with...
I've written the following which would show both fuel flows, but I'm not quite sure how I should set it up on Acrobat...
G-WKTH "{'departure’: '16’, 'endurance’: '10', 'transit’: '13.8', 'final_res': '10.5'}"
G-WKTI "{'departure’: '16’, 'endurance’: '10', 'transit’: '13.8', 'final_res': '10.5'}"
9H-DGM "{'departure’: '16’, 'endurance’: '10', 'transit’: '13.8', 'final_res': '10.5'}"
9H-DGN "{'departure’: '16’, 'endurance’: '10', 'transit’: '13.8', 'final_res': '10.5'}"
G-DJET "{'departure’: '14’, 'endurance’: '7.3', 'transit’: '10.4', 'final_res': '9'}"
G-ZDEA "{'departure’: '14’, 'endurance’: '7.3', 'transit’: '10.4', 'final_res': '9'}"
G-ZATG "{'departure’: '14’, 'endurance’: '7.3', 'transit’: '10.4', 'final_res': '9'}"
9H-IKY "{'departure’: '14’, 'endurance’: '7.3', 'transit’: '10.4', 'final_res': '9'}"
G-YDEA "{'departure’: '14’, 'endurance’: '8.0', 'transit’: '11.6', 'final_res': '9.5'}"
G-EMPP "{'departure’: '14’, 'endurance’: '8.8', 'transit’: '12', 'final_res': '9'}"
G-DMNG "{'departure’: '14’, 'endurance’: '8.8', 'transit’: '12', 'final_res': '9'}"
G-WKTG "{'departure’: '14’, 'endurance’: '8.8', 'transit’: '12', 'final_res': '9'}"
9H-DGB "{'departure’: '14’, 'endurance’: '8.8', 'transit’: '12', 'final_res': '9'}"
G-WKTO "{'departure’: '600’, 'endurance’: '400', 'transit’: '500', 'final_res': '300’}"
G-WKTS "{'departure’: '600’, 'endurance’: '400', 'transit’: '500', 'final_res': '300’}"
G-WKTL "{'departure’: '800’, 'endurance’: '550', 'transit’: '650', 'final_res': '400’}"
2-WKTN "{'departure’: '800’, 'endurance’: '550', 'transit’: '650', 'final_res': '400’}"
G-WKTK "{'departure’: '800’, 'endurance’: '550', 'transit’: '650', 'final_res': '400’}"
P-HZHZ "{'departure’: '800’, 'endurance’: '550', 'transit’: '650', 'final_res': '400’}"
G-RTNA "{'departure’: '700’, 'endurance’: '650', 'transit’: '750', 'final_res': '450’}"
2-WKTJ "{'departure’: '700’, 'endurance’: '610', 'transit’: '700', 'final_res': '450’}"
event.value = JSON.parse(this.getField("Name").value).departure
event.value = JSON.parse(this.getField("Name").value).endurance
event.value = JSON.parse(this.getField("Name").value).transit
event.value = JSON.parse(this.getField("Name").value).final_res
Where can I put this array? How would I call it in each cell?
Sorry if all this sounds very basic.. I just can't find any information online... 😞
People will choose "Aircraft Registration", and then choose the type of task. Once these two are set, then javascript should populate the EFO (Estimated fuel onboard) field each hour (starting from an amount set by the user and then subtracting the fuel flow per hour from said amount)...
Sorry if it's a bit confusing. I'm trying my best! 😄
I've attached the PDF here, so you can see...
Thanks in advance!!