Skip to main content
Participating Frequently
September 8, 2020
Question

Javascript for Drop down menus

  • September 8, 2020
  • 5 replies
  • 961 views

Hi all, I would like some help with a Javascript. I am trying to create drop down menus that when a category is selected from the first drop down menu, the second drop down menu will auto-populate with options relating to that category. For example:

I would like my first drop down menu to have 2 options, first one being 'Material Classifications' and the second being 'Machine Classifications'

When 'Material Classifications' is selected from the first drop down menu, I would like the second drop down menu to auto populate with the following:

Fuel - Diesel

Fuel - ULP

Lubrication - Fluid

Lubrication - Grease
Lubrication - Oil

Coolant

Surface Coating - Acid

Surface Coating - Paint

Surface Coating - Solvent

Gases - Acetylene

Gases - Argon

Gases - Nitrogen

Gases - Oxygen

Gases - Refrigerant

Gases - Argoshield (Ar, O, Co2)

Electrodes - E308

Electrodes - E410

Electrodes - E7018

Electrodes - E71T

Electrodes - ENi-CL

Electrodes - ER5154

Electrodes - ER70S

Electrodes - Paste/Powder

No Category

When 'Machine Classifications' is selected from the first drop down menu, I would like the second drop down menu to auto populate with the following:

Bus

Car

Light Goods Vehicle <3.5T

Medium Goods Vehicle 3.5 - 12T

Heavy Goods Vehicle 12-15T

Very Heavy Goods Vehicle >25

Miscellaneous

Road Grader

Off Highway Truck

Roller/Compactor

Scraper

Stationary Large Engines >450KW

Stationary Small Engines <450KW

Track Loaders with bucket

Bulldozer

Wheeled Dozer

Wheeled Loader

Tractor

No Category

I am using Adobe Acrobat X Pro. I am familar with javascript but still would consider myself a beginner. I thought I had the correct Javascript but no luck. Any one able to provide me with steps & javascript for the above? TIA.

 

This topic has been closed for replies.

5 replies

Tahya5F84Author
Participating Frequently
September 10, 2020

Greatful that I have had a kind person help me acheive the result I was after. Thank you all for your help

Nesa Nurani
Community Expert
Community Expert
September 9, 2020

Here is working file with codes. Test it and let me know if you need additional help.

PDF 

Tahya5F84Author
Participating Frequently
September 10, 2020

Thank you 🙂

Bernd Alheit
Community Expert
Community Expert
September 8, 2020
Tahya5F84Author
Participating Frequently
September 9, 2020

Hello, thanks for your reply.

I found your sample file interesting in the way it explains dependent lists, and it looks how I would like my form to operate. However, I am still unsure how to implement it into my form.

Thank you for your information.

try67
Community Expert
Community Expert
September 8, 2020

You can use this (paid-for) tool I've developed to achieve it, without having to write any code:

http://try67.blogspot.com/2012/09/acrobat-create-dependent-dropdowns.html

Tahya5F84Author
Participating Frequently
September 9, 2020

Hello, thank you for your reply.

I am working on these drop down menus as part of my job, so I was hoping to source one via feedback and help from others rather than paying. I wasn't really aware javascript was something you needed to purchase. I hoped to had figured it out myself but couldn't seem to get the code I was using to work. Perhaps I could post the code I was working on and someone may be able to advise where I was going wrong. Thanks for your time.

Inspiring
September 9, 2020

"I am working on these drop down menus as part of my job"

So you will get paid for thing we make you, and thats fair for you?

If I spend few hours making code for you and not get paid thats fair for you?

Would you like if your boss tell you you won't get paid for your job?

Inspiring
September 8, 2020

Do you have code we can help you with? Or do you want someone to write code for you?

if it's second case I could do it for a fee, if you'r interested send me PM.

Tahya5F84Author
Participating Frequently
September 9, 2020

Hi, thanks for your reply. I am working on a form for my work and didn't realise javascript was usually issued for a fee. I have previously used and sourced javascript for other areas of work, so I would like to learn myself if possible but thank you for the offer.