Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to present a second set of options based on a users selection from a pulldown menu

Featured Replies

I am using XSLT pages to collect demographics for a user. In one of the selections the user chooses a campus they are associated with from a pull-down menu. Based on their campus selection I want to present them with the departments associated with that campus so that they can choose one.

I am not sure how to go about this. The campuses and departments are located in the database files. Any assistance would be greatly appreciated.........Ray

What is total number of options?

= Sum_i ( option_i,1 * option_i,2)

If it is low (say less than 50-100), you could load all in JavaScript array (or even send a JavaScript array), and then use JavaScript to display pulldown menu 2 as function of the value selected in pull-down menu 1.

If it is considerable, I would think of AJAX and retrieve the data of the second menu in the moment it is needed.

I ditto that. Use AJAX. In your first "" add an "onchange()" call to a javascript. This makes the call to XMLHttpRequest() (or ActiveXObject("Microsoft.XMLHTTP") if Windows). The request calls a script to make the actual query to the database, returning the results. Your second "" is not a select at all, but a "

" that gets dynamically replaced when the first "" changes. Very cool.
  • Author

Just returned from a three day weekend, many thanks for your comments Martin and Beverly.

The "Campus" field is defined as a "Custom Value-List" with 10 campus names. Based on the users campus selection I would like to present them with a pull-down menu of between 1 and 120 departments. These departments are located in a "Department" file and each one is associated with a "Campus" from the "Participant" file. You can see the "New Registration" page with the two fields being discussed by clicking on the link below:

http://128.123.83.183/fmi/xsl/Registration%20DB%20XSLT/new_participant_reg.xsl

I have attached the XSL page where the form begins on line 371 (changed file type to txt since xsl was not a valid file type). Will the "onchange()" call be activated when the user selects the "Campus" field? I am not familiar with AJAX and will have to research this.....Ray

new_participant_reg.txt

  • Newbies

Wow! This is exactly the problem I have, only I'm working completely within FMPro Advanced 8.5.

I've looked and looked for this problem on the forums but haven't seen anything but this.

Once again, it's the same interface design but I can't seem to get it to work.

Thanks for any advice!

Enclosed a small demo file that does the second menu lookup with AJAX.

In addition, you need to download and install the prototype library from http://prototype.conio.net/

Have fun!

twomenus.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.