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.

Value list "also display values from" online

Featured Replies

Greetings,

I want to replicate the behavior of the "also display values from" option of field based value lists online.

Allow me to explain:

I want a menu on my web page that will display both vallues but submit only the first value, like it would behave on the Filemaker interface.

I could not find a CDML way of doing this, it would need to involve javascript. Please proove me wrong laugh.gif

Thanks

Howdy!

I do not think a field-based value list should be a problem unless it is relational and from another db. I could not find the "also display values from" option in FM5 (maybe I missed it?) but there was something similar about using a value list from another file. If it is relational, then I think you are right because I remember reading posts about problems with relational value lists in CDML, but I cannot remember exactly since I have not used them in FileMaker db or web before.

Sorry, no proof one way or the other... just passing along a vague reference I remember reading a few times. wink.gif

--ST

  • 2 weeks later...
  • Author

The problem is not that the value list is on another file. The problem is that the CDML replacement tag for value lists only returns the value for the first field (eg the value from the field specified in "also display values from" does not show).

Steve T. the "also display values from" is in "Define Value List", in the "Specify..." dialog box of the "Use values from field".

So let's say I have a value list from the field ClientID and I specify in "also display values from" to also display the field ClientFullName so that Clients don't have to know their ID by heart. On the FMP interface, the client would look at the list and see their name next to their ID but, after the selection is made, only the ClientID is inserted in the field, not their name.

I am trying to recreate this behavior online. I want the client to see a menu with all the client IDs and names BUT i want the value of the chosen option to be only the ClientID.

Any help is greatly appreciated ! Thanks to all.

I can't prove you wrong about the Javascript. However here is a method using a Calc field to "join" the two fields with a ":" character. Then create a ValueList of this field.

Then with some Javascript place them on the desired locations, like this:

<select name="stuff">

<script>

[FMP-valuelist: Groups, List=GroupList]

val =  "[FMP-valuelistItem]".split(":") ;

document.write("<option value='" + val[0] + " [FMP-valuelistChecked]>" + val[1] + "</option>") ;

[/FMP-valuelist]

</script>

</select>

Good Luck.

Garry

Unless security is not an issue, won't such a dropdown allow

Smith 02020

to select and enter as

Jones 32456

?

As an example you may have a products database. It contains a "prodname" field and a "prodid" field.

The Calculation field "prodnameid" = prodname & ":" & prodid

A ValueList is created for this field called "prodnameidVL".

The page contains:

<select name="prodid">

<script>

[FMP-valuelist: prodnameid, List=prodnameidVL]

val =  "[FMP-valuelistItem]".split(":") ;

document.write("<option value='" + val[1] + " [FMP-valuelistChecked]>" + val[0] + "</option>") ;

[/FMP-valuelist]

</script>

</select>

The Select Drop-down would have the "prodid" as the Value and "prodname" as the display.

All the best.

Garry

  • 4 weeks later...
  • Author

That's awesome, thanks again Garry.

So there really isn't a CDML way of doing this right ?

Cheers

  • Author

Missing quote.

Gary provided an excellent working solution (Thanks Garry) but there is a missing single quote before [FMP-valuelistChecked] so the code should actually be B)

<select name="prodid">

<script>

[FMP-valuelist: prodnameid, List=prodnameidVL]

val = "[FMP-valuelistItem]".split(":") ;

document.write("<option value='" + val[1] + "' [FMP-valuelistChecked]>" + val[0] + "</option>") ;

[/FMP-valuelist]

</script>

</select>

Like this it works flawlessly.

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.