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.

Problems with FMView's "getInputChoices"

Featured Replies

I have been debugging an issue that i have with a PHP form connected to FileMaker and have narrowed the issue to my function. I am new to PHP forms, and I think this might be a relatively easy fix, but am not sure how to approach it. Here is the issue:

When I have a field getting a value list from FMP, and the value list has a strings (with spaces) as one value, the values appear on the form, but if I check the box, save, and return to the form, the value with a space between words is unchecked. On exaiming the FMP field in the filemaker, the data is there. There seems to be an issue with the function getInputChoices echoing the string, although the value is checked in filemaker.

Here is the function:

function getInputChoices($type, $valuelist, $fieldvalue, $fieldName) {

$selected = "";

$fieldValueArray = explode(" ", str_replace("n"," ", $fieldvalue));

foreach ($valuelist as $eachvalue) {

if (in_array(trim($eachvalue), $fieldValueArray)){

$selected = " checked";

}else{

$selected = "";

}

if ($type == "checkbox"){

echo "$eachvalue";

}else{

echo "$eachvalue";

}

}

}

I am not sure if it has to do with the $eachvalue only referring to the first word of the value list line, or something else.

Suggestions?

This is your problem.

$fieldValueArray = explode(" ", str_replace("n"," ", $fieldvalue));




 You're replacing FMP's newline value delimiter with a space and then telling php to use spaces as the delimiter for setting up the array.  Why not just use the following?




$fieldValueArray = explode("n",$fieldvalue);

Edited by Guest

  • 2 weeks later...
  • Author

Hey Baloo,

This worked perfectly - thanks so much!

I am just getting my feet wet with php, so things like this help me to understand it a little more. Thanks again,

-dana

  • 1 year later...
  • Newbies

Hi guys,

i would also want to change this function, where do you find it? i've been looking in filemaker.php but without succes :s

grtz

  • Author

The code is in the fmview.php file. Just search the code for getinputchoices.

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.