Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6092 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi everybody, i´m new usingfile maker and I don´t know how to validate that the user must just input 12 chars into a field ...

Actually if the user input more that 12 chars into a field i get the message, "sorry, you must enter 12 chars... (I write this messahe into the Display custom message if validation fails option), and this happens (i think) because i´m reading data from a mysql database (using ODBC connector and that field is defined as a varchar type and size 12 ). I also try to use the Length(field) funtion but is not working ...

Would somebody please help me with this issue ?

Thanks in advance ....

Posted

Checking 'Validate by calculation' and specifying the following calculation should work:

length(field) = 12

Posted

I also try to use the Length(field) funtion but is not working ...

I was going to recommend the Length Function earlier, but didn't because of what you wrote. I wasn't at my desk at the time, so I left it until now.

Please explain why it didn't work.

Lee

  • Newbies
Posted

The length function is not working because it takes 12 as a value, so if I don´t input 12 in the field that i´m validating there is always the custom message warning ....

thanks any way!

Posted (edited)

I believe you are misinterpreting Length() and validation in general.

A validation calculation only produces 1 or 0, true or false. The validation must produce true. If it produces false, the validation message will fire. So a validation by calculation of:

Length ( thatField ) = 12

... means the field must contain exactly 12 characters or it will fail validation. If you can tell us EXACTLY what you are doing, we can find out why it breaks. :wink2:

Edited by Guest
Posted

To explain just a bit more ...

The length function is not working because it takes 12 as a value,

No. Length() counts how many characters are in a field. So in your situation, you are asking a question: Does the length of that field equal 12? It has nothing to do with the data itself; it only counts the number of characters.

But I wonder ... are you editing SQL fields directly? If you are, it may not be validation which is failing but rather your privileges to modify a SQL field. Just another consideration ... Anyway, the calc Matthew gave indeed works and as Lee asked, please provide details of what you have, what you are doing and what the error message specifically says.

This topic is 6092 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.