October 27, 200619 yr 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
October 30, 200619 yr 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.
October 31, 200619 yr 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.
November 1, 200619 yr 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
November 2, 200619 yr 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!
November 3, 200619 yr 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