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.

Conditional Value Lists and PHP

Featured Replies

There's nothing as humbling as learning something new!

I'm trying to build a simple site in order to learn PHP. I've created a FM file with two fields. They are formatted as popup menus, and the second's choices are conditional upon the first.

I ran the PHP Site Asst. and have a little sample site. However, the second popup's choices are not updating if the first choice is changed (I need the commit/reload).

So, I poked around FM Advisor and found J. Starke's sample of how to create condtl value lists in PHP using Ajax. However, his example doesn't include editing an existing record, just submitting a new one. I can't seem to see how to load an existing record without wiping out the data in the popups.

And so, here I am. I understand what Jonathan did, but not enough to add it to my site, so that I can load an existing record, and edit it with my popups working conditionally.

Love to be pointed in the right direction for examples. Any good php forums out there?

First off, I truly I loathe the site assistant. Its code is pretty much not extensible and is unnecessarily obtuse.

I would highly recommend that you not use the Site Assistant to learn PHP. Backing up I'd actually start with simple non FMP-API PHP. There are several on-line tutorials and/or books to get you started with the basic syntax and functionality. PHP's on online documentation is also quite good. http://www.php.net/manual/en/

If you insist on starting with the API, I'd advise taking a look at the the API example code included with the FMS installation. /HD/Library/Filemaker Server/Examples/PHP/API Examples on my Mac sandbox.

If you're going to use Ajax you're going to need to learn JavaScript as well (this is most likely the root of your problem).

There a several Web development bulletin boards out there, but I'd try Google before posting on most of them. I'm also happy to answer any general PHP questions here.

Lastly, It will be a lot easier to point you in the right direction once I have a better idea where you are. i.e please post the code you have, and I'll take a look at it.

  • Author

Baloo, many thanks.

I find that the php tutorials are very basic (even the php manual) and don't show how to do "advanced" interface methods, such as condtl value lists.

Not surprising that the PHP SA produced pages aren't the best examples of code. Kinda like any wizard.

I've bothered the wonderful Alex (Genx) for some help, and he has provided me with some sample code to study.

I'm sure I'll be back.

I find that the php tutorials are very basic (even the php manual) and don't show how to do "advanced" interface methods, such as condtl value lists.

That's because PHP isn't an interface language. It's a server side scripting language. Your interface will generally be written in HTML, CSS, and JavaScript.

Also if you're going to use Ajax I've found JSON (instead of XML) to be the bast way to pass data from PHP to Javascript. It's also a lot easier thanks to PHP's built in JSON functions

One more tip: when Googling for help use HTML semantics instead of Filemaker semantics

  • Author

Yes, I understand. Thanks for the link. My whole project is out there, written in pieces!

This takes me back to reviewing JMO's demos and piecing together his techniques to create a system.

Create an account or sign in to comment

Important Information

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

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.