RoadrunnerRay Posted October 27, 2006 Posted October 27, 2006 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
Martin Brändle Posted October 30, 2006 Posted October 30, 2006 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.
beverly Posted October 31, 2006 Posted October 31, 2006 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.
RoadrunnerRay Posted November 1, 2006 Author Posted November 1, 2006 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 farmerd79 Posted November 2, 2006 Newbies Posted November 2, 2006 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!
Martin Brändle Posted November 3, 2006 Posted November 3, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now