breicher Posted July 29, 2004 Posted July 29, 2004 I've got a FM database that works fine in FM but doesn't wor kwhen published to the web. I've got 2 drop down lists. 1 for Builings and 1 for Rooms. The rooms list is based on what building is selected. The Building drop down works fine but he rooms drop down dosn't udate after a room is selected. Is there a way to make this work? http://198.110.228.22/FMRes/FMPJS?-db=he...p=and&-view fm.zip
Garry Claridge Posted July 29, 2004 Posted July 29, 2004 If you were using CDML (Custom Web Publishing) you could build "dynamic" dropdowns. However, I doubt that Instant Web Publishing is capable of this. Good Luck. Garry
breicher Posted July 30, 2004 Author Posted July 30, 2004 I created a html page based on another that I found but it didn't have any drops downs. Can someone help me with the syntax? I put in radio buttons for the first drop down temporarily. http://198.110.228.22/helpdesk.html Thanks
Garry Claridge Posted July 30, 2004 Posted July 30, 2004 You can use one of two basic concepts to achieve this. One, when the Building dropdown is changed the database is queried and the page is reloaded with the options for the Room. Two, all options are loaded into a Javascript array and whenever the Building is changed the Room options are automatically updated. Over the weekend I will have look at your databases to see if any problems exist. All the best. Garry
breicher Posted August 2, 2004 Author Posted August 2, 2004 I can't even figure out where to begin to do this. Can you help me out? Thanks, Brad
Unable Posted August 3, 2004 Posted August 3, 2004 You can find working examples of drop down lists in the Sample Files forum. Might be under -LOP values or -Op values and symbols or one of the other sample demonstratons in CDML.
Jeff Spall Posted August 3, 2004 Posted August 3, 2004 Hi, I built some java arrays a short while ago after a LOT of help from the forum (like kinda writing the whole thing for me!) The enclosed file has the java include file and the basic page html in one. I just hard-coded everything in as it would hardly ever change, but you could deliver the arrays from a database. This example has two or three levels depending on the first choice and runs at http://adserve.william-reed.net - follow the "advert specs" link regards, jeff java_arrays.txt
Garry Claridge Posted August 3, 2004 Posted August 3, 2004 Here is a working solution for your database. Place this Javascript/CDML code in the <head> of the "helpdesk.html" format page: <script> var aBuildingNames = new Array(); var aBuildingRooms = new Array(); var aRooms = new Array(); var currBuilding = ""; var i = 0; var j = 0; [FMP-InlineAction: -db=Room.fp5, -sortfield=Building, -sortfield=Room, -max=all, -findall] [FMP-Record] if ("[FMP-Field:Building]" == currBuilding) { aRooms[i++] = "[FMP-Field:Room]"; } else { if (currBuilding != "") { aBuildingRooms[j++] = aRooms; var aRooms = new Array(); i = 0; }; currBuilding = "[FMP-Field:Building]"; aRooms[i++] = "[FMP-Field:Room]"; }; [/FMP-Record] [/FMP-InlineAction] aBuildingRooms[j++] = aRooms; function updateRooms() { nRoomsOld = document.Survey.Room.options.length; for (a=nRoomsOld-1; a > 0; a--) { document.Survey.Room.options[a] = null; }; nSelectedBuilding = document.Survey.Building.selectedIndex; nRoomLen = aBuildingRooms[nSelectedBuilding].length; for (a=0; a < nRoomLen; a++) { document.Survey.Room.options[a+1] = new Option(aBuildingRooms[nSelectedBuilding][a]) ; document.Survey.Room.options[a+1].value = aBuildingRooms[nSelectedBuilding][a] ; }; }; </script> </head> Place this Javascript/HTML code in the appropriate place in your "helpdesk.html" page: <td rowspan="4" align="left" valign="top"> <font color="#00000"> <select name="Building" onChange="updateRooms();"> <option>Albee</option> <option>Big Rock</option> <option>Brady</option> <option>Middle School</option> <option>High School</option> </select> <select name="Room"> <option value="">Select a Room</option> </select> <script>updateRooms();</script> </font></td> You will need to call this page with a URL like this: http://localhost/FMPro?-db=Helpdesk.fp5&-format=helpdesk.html&-lay=Technicians%20View&-view All the best. Garry
breicher Posted August 3, 2004 Author Posted August 3, 2004 Wow! That is way over my head. I greatly appreciate your help. Thanks! Brad
breicher Posted August 3, 2004 Author Posted August 3, 2004 Here it is working http://helpdesk.chesaningschools.net/FMP...0View&-view
Recommended Posts
This topic is 7409 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 accountSign in
Already have an account? Sign in here.
Sign In Now