May 17, 200817 yr Newbies 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 ....
May 18, 200817 yr Checking 'Validate by calculation' and specifying the following calculation should work: length(field) = 12
May 18, 200817 yr 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
May 19, 200817 yr Author Newbies 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!
May 19, 200817 yr 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 May 19, 200817 yr by Guest
May 19, 200817 yr 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.
Create an account or sign in to comment