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.

Drop down list not working

Featured Replies

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

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

  • Author

I'll give CDML a shot and check back.

  • Author

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

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

  • Author

I can't even figure out where to begin to do this. Can you help me out?

Thanks,

Brad

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.

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

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

  • Author

Wow! That is way over my head. I greatly appreciate your help.

Thanks!

Brad

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.