Jump to content

Validating fields - Removing Spaces


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

Recommended Posts

Hi Everyone!

This is such a simple thing, but for some reason I cant figure out how to do it, nor can I find any info online about this.

How do I validate a field using a calculation to remove spaces or carriage returns in a field.

For example lets say I type "hello 123", I want it to automatically appear in the field as "hello123", or if I type "hello123 ", I want it to appear as "hello123"

Thanks!

Link to comment
Share on other sites

Validating will not change the data; it will alert the user that the data is invalid and must be changed.

An auto-enter calculation with 'do not replace existing value' deselected WILL change the data as required, without alerting the user that the original data was invalid.

If you still would rather validate than automatically correct the data, use

not (Position( fieldName; " "; 0; 1 ) or Position( fieldName; ¶; 0; 1 ))

or

not (PatternCount( fieldName; " " ) or PatternCount( fieldName; ¶ ))

Link to comment
Share on other sites

Thats brilliant. I'm sorry I didnt realize that validating would only warn someone. Changing it automatically via the auto enter is a much better solution. Thank you so much!

One more quick thing.

If I want to just delete a leading or trailing space in another field, how would I approach that?

Edited by Guest
Link to comment
Share on other sites

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