spb Posted January 6, 2005 Posted January 6, 2005 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
QuinTech Posted January 6, 2005 Posted January 6, 2005 Hi, Steve. Validate with: theField = Lower (theField) HTH, Jerry
transpower Posted January 7, 2005 Posted January 7, 2005 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!
QuinTech Posted January 7, 2005 Posted January 7, 2005 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
QuinTech Posted January 7, 2005 Posted January 7, 2005 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
spb Posted January 7, 2005 Author Posted January 7, 2005 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
spb Posted January 7, 2005 Author Posted January 7, 2005 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
Ender Posted January 7, 2005 Posted January 7, 2005 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)
Ender Posted January 7, 2005 Posted January 7, 2005 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))
Ugo DI LUCA Posted January 7, 2005 Posted January 7, 2005 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
mcstar Posted March 17, 2005 Posted March 17, 2005 Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
mcstar Posted March 17, 2005 Posted March 17, 2005 Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
mcstar Posted March 17, 2005 Posted March 17, 2005 Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
bikergeek Posted March 18, 2005 Posted March 18, 2005 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.
bikergeek Posted March 18, 2005 Posted March 18, 2005 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.
bikergeek Posted March 18, 2005 Posted March 18, 2005 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.
Recommended Posts
This topic is 7283 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now