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.

Formattting a value list on a search results page

Featured Replies

Hi,

Just a question about displaying a selected checkbox on a search results page.

I am using a value list to hold the values. When the value list is displayed online, it is in the form of checkboxes. When the user searches for his/her records, and then sees the search results on the search page, how do I display which checkbox the user has selected?

I know to display other fields, such as name, it would be [FMP-Field: FirstName], so forth and so on. I just don't know how it works for value lists displayed as check or radio boxes.

Thanks for any insight,

Cristy

Check [FMP-ValueList], [FMP-ValuelistItem] and [FMP-ValueListChecked] in the "CDML Reference" database. It gives a good example of how this works.

All the best.

Garry

It is good to have choices.

In addition to Garry's advice, you can also place a field formatted as a valuelist on one layout on another layout where you can format the same field as standard. You can then access that data with the fmp-field tag should you choose to do so. And you can use the break encoding for design purposes.

Hi, here's the CDML code I've been using for checkboxes on search results/record detail pages, where you define the values manually. This one has the advantage that the checkbox name can be different from the value list.

<input type="checkbox" name=fieldname value="field value1" [fmp-if:FIELD:fieldname .eq. field value1]CHECKED[/FMP-IF]>

......you then repeat it for each value of the checkbox.

BEWARE: If you pick up this bit of code from the FileMaker reference the example doesn't have the "" around the field value, so it doesn't work.

To pick up all the values from FileMaker:

[FMP-VALUELIST: fieldname, LIST=listname]

<INPUT TYPE="checkbox" NAME="fieldname" VALUE="[FMP-ValueListItem]"[FMP-ValueListChecked]>[FMP-VALUELISTITEM: Always, HTML]

[/FMP-VALUELIST]

....this second one build the checkboxes dynamically from the value list so you don't have top go back and change the html when the list changes.

regards, jeff

  • Author

Thanks a ton!

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.