Jump to content

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

Recommended Posts

Posted

Hi BFH smile.gif

Drop the number! It must be a typo. I use the following formula to prohibit carriage returns all the time.

not PatternCount(yourtextfield, "

Posted

Hi,

Try this with your field name in place of TextField and it should work.

Length (TextField) <= 50 and not PatternCount(TextField, "

Posted

Thanks for both replies, but I still must be doing something wrong. What do I need to do differently?

As mentioned in my original post, I had tried substituting an equal sign for the ? and it did not prevent me from entering a carriage return in that text field.

But, since you mentioned it, I tried again. Same result: I still can press the Return key in that field and the cursor goes to a new line.

I then tried deleting the ? 1 from the calculation. After doing so, I still could press the Return key in that text field. Then I clicked out of that field and an alert displayed. "This field is designed to contain only specific values. Allow this value?" The buttons are Revert Field, Yes, and No. Clicking Yes results in the carriage return staying in the field.

Not good.

LaRetta: How did you first learn about this technique for preventing extra lines in a text field?

Thanks.

Posted

Hi BFH,

Hmmmm, the formula I gave you needs to be applied directly to the field in FIELD DEFINITIONS. Select File > Define Fields, select your field, go to options, select validation tab, validate by calculation and enter the formula I gave you:

not PatternCount(yourtextfield, "

Posted

I made a little test file based on the Tech article, and I can send you a copy of it if you want, just let me know .sit or .zip.

I have also checked your calculation and reread your post.

So that you know, you're not going crazy, the curly quotes and the ? were both behind the problem. Why FileMaker allowed this to be posted as a tech article with all of the errors is beyond me, but, just make those changes and it should work.

HTH

Lee

smile.gif

Posted

Hi LaRetta,

Many thanks for the prompt and helpful reply.

I had done exactly the steps you provided and still was able to enter a carriage return.

I now have added the message and selected the "strict do not allow user override" checkbox. After this, I still am able to enter a carriage return. When I click out of the text field, a dialog displays that contains my message and presents two buttons; Revert Field and OK. The OK button allows the carriage return to remain. Not good!

I have attached a screen capture (JPEG) to show you what I have done.

So I must still be doing something wrong and am desperately in need of an anti-duh pill.

Screen capture 1.jpg

Posted

Many thanks, Lee.

As mentioned in my above reply, I still am unable to fix/solve the calculation. Even after changing the curley quotes and removing the ? 1, I still am able to enter a carriage return in the text field that I am using for experimentation.

Very embarrassing.

Posted

Well, BFH, something is certainly wrong crazy.gif The only things I can suggest are:

1) Go into your calculation, copy it and paste it here for us to have a looksy.

2) What version of FM are you using?

3) Are you sure you have entered the calculation in 'Validation' tab instead of Auto-Entry section?

4) Oh, and be sure the 'validate only if field has been modified' is not checked.

4) Where are you from? My reason for asking is that sometimes International settings can affect things; such as using a ';' in place of ','

Other than that, I have no clue.

LaRetta

Posted

The steps you describe, and the fact that the message appears shows that you did all correctly. After pressing OK, you will not be able to leave the record, or go to another field. For an instance the carriage return might look 'accepted', but to continue is impossible. In the end you have to 'Revert'.

Harryk

Posted

Do not be embarrassed, You should have seen me trying to figure out relationships and portals. Of course it didn't help that every developer has their own way of referring to the keys.

Here is a very simple file, I hope it helps.

Lee

smile.gif

FieldValidation.fp3.zip

Posted

Oh Harry!

Ahhh, he's not exiting the field to activate the validation error! That's why he could still enter it! I should have thought of that.

LaRetta

Posted

I had a similar problem people where entering carriage returns spaces etc.

I found a post on the forum on how to fix the problem.(sorry I dont remember who posted this fix.)

I created a calc field for validation,I called it trim, the calc is

RightWords ("your field",9999)With this calc there is no msg it will take out any carriage returns or spaces without any fuss.

Hope this works for you.

Dean

I just did some searching and found the post it was from Andrew LeCates on 12-01-01.

Posted

LaRetta:

Thanks for replying again. Appreciate your time and helpfulness.

1. The calculation is included in that screen capture file I uploaded with my last posting to you. Were you unable to access the file or unable to open it?

2. FM Pro 5.5v2 for Mac OS X (Jaguar.4).

3. See the uploaded screen capture showing that it is in the Validation tab, not the Auto-Entry one.

4. Yes, it was. I deselected it, then tested the field, and it did not display the message. So I reenabled it.

5. I am clueless in San Diego. wink.gif

Validation tab with calc.jpg

Posted

Hi BFH,

Well, I'm a bit confused. Maybe FM 5.5 for Mac is different. But I've had 5.5 (at least I'm pretty sure it was 5.5, at least 5.0) for Windows and my calc setup screen doesn't look a thing like that!? Your setup calc screen looks like the 'Graphite' layout?! Did someone design that or is that a native setup calculation box from Field Definitions? Very strange! Can someone take a look for me?

Sorry I can't help you but good luck anyway smirk.gif

LaRetta

Posted

Harry:

Many thanks for explaining this. So it was behaving properly, after all.

Well, I can just imagine that my data-entry colleagues will be thrilled with this behavior (i.e., you click or tab outside the text field after having entered an extra carriage return, and boom; you can't). Not!

I've changed the message to say that the user should click the Revert button (OK is the default, which does not make sense to me) and stop entering extra carriage returns or else no dessert tonight! wink.gif

Many thanks and cheers!

Posted

This is FMP 5.5v2 for Mac OS X (Jaguar.4).

To keep the file size at a minimum, my screen captures are showing portions of the dialogs.

I've attached another one showing part of the Calculation window.

The Aqua user interface of Mac OS X is a delight/pleasure (not strange) for me to look at.

Point your web browser at http://www.filemaker.com/images/screenshots/fm_collage.jpg to get an idea of what FMP looks like in Mac OS X.

Cheers!

Another screen capture.jpg

Posted

I had a similar problem people where entering carriage returns spaces etc.

I found a post on the forum on how to fix the problem.(sorry I dont remember who posted this fix.)

I created a calc field for validation,I called it trim, the calc is

RightWords ("your field",9999)With this calc there is no msg it will take out any carriage returns or spaces without any fuss.

Hope this works for you.

Dean

I just did some searching and found the post it was from Andrew LeCates on 12-01-01.

mm, I do not quite grasp this. Can a calculation used for field validation actually do something, more than validating and sending a warning alone?

When you specify calculation for field validation do you enter Rightwords("yourfield",9999), or do you refer to an existing calcfield (called trim..) in that spot?

Sorry for my ignorance in this. It's an interesting not very well known issue if what you say is true: not only validating but also correcting after entering a value in a field..

Harryk

Posted

Dean:

Many thanks for the helpful reply. I just tried out your calculation on a different text field. When I put a carriage return in that field for a preexisting (test) record, I was able to tab or click in another field; no message (even though I had one configured).

I then put the cursor back in the field and found that the carriage return was still there.

How did you develop that calculation? Any idea how come it did not function properly in my test? What am I doing wrong?

Sheesh, it ought to be easier than this! wink.gif

Posted

Oh Harry grin.gif

Well said grin.gifgrin.gif Oh, BTW, I love Macs too even though I've never used one - don't even know how to turn them on, but I love them!

LaRetta

Posted

spoken like a true brain washed window person.

There isn't anything that you can run on a window machine that I can't run on my Mac.

I don't think the same is true the other way around.

Lee

Posted

Hi Lee smile.gif

Let's not have a MAC/WIN fight! Ahhhhh now!! FM brings us all together! I'd love a tin can if it allowed me to design using FileMaker cool.gif The tool isn't as important as the Interface and the Developer smile.gif

LaRetta

Posted

I use oAzium events plugin so much I forget its not part of FileMaker. To keep carriage returns and/or spaces out of the fields I put a set field command in a script that executes by oAzium.

I apologize for the confusion.

Dean

This topic is 8016 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.