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.

Validate on case

Featured Replies

I'm trying to set up a field validation forcing the user to always enter lower-case data. I can't get a calculation function to recognize the difference between "A" and "a". I managed to validate to numbers are required, with a Case with PatternCount test on all ten digits. But the case issue has me stumped.

Steve Brown

Hi, Steve. Validate with:


theField = Lower (theField)

HTH,

Jerry

How about:

Exact( theField, Lower( theField ) )

You could also automatically change the case by formatting the case, as follows: Layout Mode | select field | Format | Text | Case | lowercase. Of course, everywhere you use this field you must use this same format!

Ender, is your calc just a difference in style, or do you find that Exact() works faster or more reliably? (Or was it simply a simultaneous post?)

J

The = test is not case sensitive, but Exact is.

Well, i'll be. I thought for sure i had done it with = before, but i guess i should have tested.

Apologies to the original poster for the confusion.

J

  • Author

Very nice. Thanks all. I'm trying to set up a field for a user to create a new password. I want this new password to always be all lowercase, and it must include one or more numbers. Using a test field called "Valitest," I am validating with this:

Case(PatternCount(Valitest, "1"), 1,

PatternCount(Valitest, "2"), 1,

PatternCount(Valitest, "3"), 1,

PatternCount(Valitest, "4"), 1,

PatternCount(Valitest, "5"), 1,

PatternCount(Valitest, "6"), 1,

PatternCount(Valitest, "7"), 1,

PatternCount(Valitest, "8"), 1,

PatternCount(Valitest, "9"), 1,

PatternCount(Valitest, "0"), 1,

Exact(Valitest, Lower(Valitest)), 1,

0)

This seems to do the job.

Normally Filemaker's persistent case insensitivity is something I appreciate. It's nice to know of a handy function like Exact for those special needs.

Steve Brown

  • Author

Er, that doesn't work, but *this* does:

Case(PatternCount(Valitest, "1") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "2") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "3") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "4") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "5") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "6") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "7") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "8") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "9") and Exact(Valitest, Lower(Valitest)), 1,

PatternCount(Valitest, "0") and Exact(Valitest, Lower(Valitest)), 1,

0)

Steve Brown

Your case will stop as soon as it finds a number. Better use an "and":

Case(

(PatternCount(Valitest, "1") or

PatternCount(Valitest, "2") or

PatternCount(Valitest, "3") or

PatternCount(Valitest, "4") or

PatternCount(Valitest, "5") or

PatternCount(Valitest, "6") or

PatternCount(Valitest, "7") or

PatternCount(Valitest, "8") or

PatternCount(Valitest, "9") or

PatternCount(Valitest, "0")) and

Exact(Valitest, Lower(Valitest)), 1)

Actually, we can simplify this a bit more by getting rid of the case:

(PatternCount(Valitest, "1") or

PatternCount(Valitest, "2") or

PatternCount(Valitest, "3") or

PatternCount(Valitest, "4") or

PatternCount(Valitest, "5") or

PatternCount(Valitest, "6") or

PatternCount(Valitest, "7") or

PatternCount(Valitest, "8") or

PatternCount(Valitest, "9") or

PatternCount(Valitest, "0")) and

Exact(Valitest, Lower(Valitest))

Why not

TextToNum(Substitute(Substitute(Substitute(digitest;"0";"1");"n";"y");"f";"t")) and Exact(Valitest, Lower(Valitest))

I'm even unsure the n to y and f to t substitution are needed. I would say

TextToNum(Substitute(digitest;"0";"1")) and Exact(Valitest, Lower(Valitest)) is sufficient

  • 2 months later...

Hi All,

In FM7, how about simplifying by using the Filter function:

(not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))

Hi All,

In FM7, how about simplifying by using the Filter function:

(not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))

Hi All,

In FM7, how about simplifying by using the Filter function:

(not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))

Why would you be insisting that a password be all lowercase?

And why not just have the field have an auto-enter calculation:

[replace] = Evaluate ( "Lower ( pwdField )" ; pwdField )

This will automatically replace any uppercase text with its lowercase equivalent when the user leaves the field.

Why would you be insisting that a password be all lowercase?

And why not just have the field have an auto-enter calculation:

[replace] = Evaluate ( "Lower ( pwdField )" ; pwdField )

This will automatically replace any uppercase text with its lowercase equivalent when the user leaves the field.

Why would you be insisting that a password be all lowercase?

And why not just have the field have an auto-enter calculation:

[replace] = Evaluate ( "Lower ( pwdField )" ; pwdField )

This will automatically replace any uppercase text with its lowercase equivalent when the user leaves the field.

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.