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.

Verification of fields using value list

Featured Replies

Hello. I've run into an odd problem using value lists on an intranet server.

I have a field, "Assigned", with value list "Assigned" and the field is defined in Options/Validation as "Not Empty", member of value list "Assigned" and "Strict: Do not allow users to override validation."

While it will not allow a new record direct in the FileMaker database without a selection in that field, on the web with pulldown list for the value list it will allow a new record to be created without specifying a choice.

In case it matters, the field format on the web is (using [ and ] here):

Team Assigned to:

[select name="Assigned" size=4]

[FMP-VALUELIST: Assigned List=Assigned]

[option [FMP-ValueListItem] checked][FMP-ValueListItem]

[/FMP-VALUELIST]

[/select]

Even if I set the select code so the first value is "- No Selection -", the problem persists.

Anyone have a solution?

You should check the input fields with JavaScript before submit is made.

I've just tried this:

<body>

<form action="http://localhost:1154/FMPro" method="POST">

<input type="hidden" name="-db" value="combotest.fp5">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-format" value="views.html">

Sport2: <select name="sport2">

<option value="- No Selection -">- No Selection -</option>

[FMP-ValueList: sport2, List=sport2]

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

[/FMP-ValueList]

</select>

<input type="submit" name="-new" value="New Record">

</form>

</body>

With the same restrictions, i.e.:

"Not Empty"

"Member of Value List Sport2"

"Strict...."

I receive an error if I select "- No Selection -".

Good Luck

Garry

  • Author

Thanks, Garry. That was the solution!

One more question: Is there an "include" code in the FMP web server akin to the <!--#include: xxxxxxx--> statement in Apache?

Yes there is an "Include". Here is an example from the "CDML Reference" database:

[FMP-If: CurrentError .eq. 509]

[FMP-Include: requirefield.htm]

[FMP-Else]

[FMP-Include: othererror.htm]

[/FMP-If]

All the best.

Garry

  • Author

Thanks!

"[select name="Assigned" size=4]"

"...akin to the <!--#include: xxxxxxx--> statement in Apache?"

The brackets of this line, and the "include...Apache" query suggest to me that someone needs to get (and read) the CDML Reference Database to make their life as a developer easier.

Links can be found by searching that string in the CDML forums.

Good luck

Seeing that the CDML [FMP-If] tags are not working properly within the Select tags Javascript will need to be used. Here is a Javascript example:

<body>

<form action="http://localhost:1154/FMPro" method="POST">

<input type="hidden" name="-db" value="combotest.fp5">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-format" value="views.html">

Country: <select name="Countries">

<script>myglobal = "[FMP-Field: g_Countries]";

[FMP-ValueList: Countries, List=Countries]

if ( myglobal == "[FMP-ValueListItem]")

{

document.write('<option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option>');

}

else

{

document.write('<option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option>');

};

[/FMP-ValueList]

</script>

</select>

<input type="submit" name="-new" value="New Record">

</form>

</body>

Hope this helps.

Garry

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.