Skip 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.

FMP-IF question

Featured Replies

Hi.....

Is it possible to use the FMP-If command to check whether or not a field has been filled in on a form? I basically don't want the user to be able to go to the next screen unless certain fields are filled in. I know that I can restrict the field in the database, but I was wondering if the web form could check this for me.

I have an example in JavaScript but I don't know how to make the reference to the FM field.

Any suggestions?

Thanks! Donna

Yes, it is quite possible. The parameter .cn. or .ncn. is often useful for this. Refer to your CDML Reference Database.

RE: I have an example in JavaScript but I don't know how to make the reference to the FM field.

You are not doing reference to FM field with JS, but you should check by JS if the field is not empty BEFORE you will submit something.

That way the validation is instantaneous and not the submit -- fill the db -- response page -- fill in

Definitely use the JS

This is the one I use for a login routine (courtesy of Armando Ghisalberti)

<script language="JavaScript">

function validate_loginform() {

validity = true;

if (document.loginform.Username.value == "")

{

alert('Enter Username !');

document.loginform.Username.focus();

return false;

}

if (document.loginform.Password.value == "")

{

alert("Enter password!")

document.loginform.Password.focus();

return false;

}

if (validity)

return validity;

}

</script>

</HEAD>

<form name="loginform" action="FMPro" method="post" onSubmit="return validate_loginform()">

<INPUT Type=text name=Username size=220

<INPUT Type=password name=Password size="">

If you will rely on JS, put some redirection to page explaining about JS into HEAD to noscript tags for browsers with JS off.

  • Author

Thanks! I'll give it a try!

Donna

Although I agree that JavaScript is probably going to be the best solution, I heard you can also do this completely in FileMaker using global fields (I have not used this myself but thought I should mention it in case you already have JS scripting in your code and are worried about conflicts).

You can also use "Field Validation" and a "-error" Format file. This format file tests for the relevant breech of field validation and reports the result.

All the best.

Garry

And you can do it with your own password (unique identifier) schema through a -Find.

But JS (client handling) is the best way. Why tie up the db file(s) with unnecessary actions?

I agree smile.gif

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

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.