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.

PHP, FMP and Checkboxes using FX

Featured Replies

  • Newbies

I'm have a bit of trouble making checkboxes send back what has been checked to the FMP db.

In FMP, I've set up one Field (FIELDNAME) as 'checkboxes' with a 6 item Value List (myValueList). I can read/display the correct items from the db, but I'm not sure how to get it back into the db once changes have been made.

// i explode $formInfo['FIELDNAME'][0] because FX sees the contents of

// that field as: items checked with a newline inbetween each item

$checkboxParts = explode("n", $formInfo['FIELDNAME'][0]); // $formInfo is [data] array from FX



$cbList = $allLists['myValueList']; // $allLists is [valueLists] array from FX

    foreach ($cbList as $cbChoice) {

        foreach ($checkboxParts as $checkboxSelected) {

            if ($cbChoice == $checkboxSelected) {

                $selection = " CHECKED";

                break;

            } else {

                $selection = "";

            }

        }

   $cboptions .= "<input id="boxes" type="checkbox" name="FIELDNAME" value="yes"" . $selection . " /> " . $cbChoice . "<br />n";

    }

print "$cboptions";

	?>  

It works if I make each checkbox it's own Field with it's own 1 item Value List.

Any suggestions/solutions?

D

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.