Jump to content

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


RoadrunnerRay

This topic is 6407 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6407 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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