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 to select field

Featured Replies

Hi All,

Thought this would be easy, but I can't work out the elegant way to acheive it.

I have a drop down list which contains all my field names. Using this, my users can select the field they want results to sort by when submitting a form. Easy.

My problem is that the field names don't translate to human readable format. eg. I have a field called "serialNumber", but I want the list to show "Serial Number". Or worse, field is "sites::siteCode", list should display "Site Code".

I could use if statements, but I'm sure there must be a more efficient way.

Appreciate any help!

Cheers...Sean.

Are you automating the population of the Selection tag? Or, are you writing the names into the page?

All the best.

Garry

  • Author

Hi Garry,

Automating sounds like a good idea, but I'm still trying to figure all this stuff out so first step I was just going to type them into the page.

I imagine it will be even trickier when I try to automate...

Thanks,

Sean.

You can just add them like this:

<select name="fields">

<option value="serialNumber">Serial Number</option>

<option value="sites::siteCode">Site Code</option>

.....

</select>

You could then read them with:

$selection_field = $_POST['fields'];

Hope this helps. All the best.

Garry

  • Author

Hi Garry,

So, simple. I should have been able to work that out.

Thank you!!

So, in order to save me much stumbling about, can you point me in the right direction for automating this?

Thanks again,

Sean.

I think you should be able to get a list of field names with:

[FMP-LayoutFields]

[FMP-FieldName]

[/FMP-LayoutFields]

An example from the CDML Reference database:

<select name="fields">

<option value="">-None- [FMP-LayoutFields]

<option>[FMP-FieldName: Raw] [/FMP-LayoutFields]

</select>

All the best.

Garry

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.