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.

Featured Replies

  • Newbies

I have a popup list created using a value list of dates in my database. Using CDML, I created a search page that contains this list, and I want the popup to appear with a date that I have set in a Global field by default. For example, when I set the date to 7/1/03 in my global date field, and the search page is accessed via the web, I want my date popup to show:

6/1/03

- 7/1/03

8/1/03

9/1/03

etc....

The user can select another date if they wish, or simply accept the default when submitting their search. Any ideas how to accomplish??

In cdml you will need to use javascript to create you popup

"when I set the date to 7/1/03 in my global date field"???

:??

I am not following....when u search for the record that has this date ooor?

u dont need pop-up u can simply submit the form with the target of "_self" and it will "open" a new window with the results...where u can "highlight-emphasise" the record/date serched for...

all the best

Hi Tewan,

set the date to 7/1/03 in my global date field

Uhhh, you need to follow date format if the global is a date field, or you'll need to convert it to date format when using it. '03' is an invalid year.

If you want Users to be able to enter any type of date format (03 for year, dashes, etc.) and it automatically be converted to FM date format, there are ways to do that also. Anyway, this probably isn't your problem, but just in case I thought I would mention it. smile.gif

LaRetta

You can use a [FMP-If] condition to test; e.g.

<select name="mydate">

[FMP-ValueList: mydate, List=myDateList]

[FMP-If: ValueListItem .eq. Field:myGlobalDate]

<option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option>

[FMP-Else]

<option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option>

[/FMP-If][/FMP-ValueList]

</select>

Hope this helps.

Garry

Can

If the date in the Global Field is not a member of the ValueList you could amend the CDML to look like this:

<select name="mydate">

<option value="[FMP-Field:myGlobalDate]" selected>[FMP-Field:myGlobalDate]</option>

[FMP-ValueList: mydate, List=myDateList]

<option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option>

[/FMP-ValueList]

</select>

All the best.

Garry

  • Author
  • Newbies

Gary,

Thanks for your response. It appears that you know exactly what I'm asking. FYI, the Global field that I'm comparing the value list items to is, in fact, a value that equals one of the ones in the value list (so your second example does not work for me). I tried the following and only get a blank popup. Do you see any syntax problems? Thanks for your help.

<select name="DateRange">

[FMP-ValueList: DateRange, List=DateRangeList]

[FMP-If:ValueListItem.eq.Field:GlobalRange]

<option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option>

[FMP-Else]

<option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option>

[/FMP-If][/FMP-ValueList]

</select>

I have just been trying that. A few strange things happening frown.gif

This seems to work, partially, in the [FMP-If]:

[FMP-If: g_curr_sport .eq. {ValueListItem}]

(rather than what is described in the "CDML Reference" database)

However, the [FMP-ValueListItem] tags, which follow, are not displaying.

I am using a "-findany" in the calling URL so that the Global Field can be read. Also, be aware that Related ValueLists do not work through WebCompanion.

I will do some more testing to see what is happening!!!

Good Luck.

Garry

  • Author
  • Newbies

Yes, I know that a Value List from a related file won't work. The value list is defined in the local file. I am able to generate the popup list without any problem when I exclude the [FMP-If:] tags, but again, the first item in the list is always selected. I am also executing a "-FindAll" on the referring page, so that the global field is availble. I tried your newest incarnation above with the [FMP-If: g_curr_sport .eq. {ValueListItem}] syntax without any change - I still get a totally blank popup.....I've tried several variations on placement of the [FMP-If] tag, etc. without any positive result...any more ideas??

Todd

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.