Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I like to check with you guys if there is any way to ensure the text that the user enter contains only numeric? I have no problem with the validation if the user enters a strign of alphabets but if he enters alphanumeric, i cant check for it.

Posted

You can validate a text field based on

Length(field) = Sum( PatternCount( field; 0 ); PatternCount( field; 1 ); PatternCount( field; 2 ); PatternCount( field; 3 ); PatternCount( field; 4 ); PatternCount( field; 5 ); PatternCount( field; 6 ); PatternCount( field; 7 ); PatternCount( field; 8 ); PatternCount( field; 9 ) )

Posted

I'm not sure, what you mean by "alphanumeric". Actually, if you check the validation option "Strict Data type: Numeric only" for the field, the user can't enter anything else but numbers (and a minus sign); make it strict, so he/she can't override the rule.

But maybe, you want to allow the user to entry anything, but want to store only the entered numbers. If your input field is of type number, you could use a calculation field c_onlyNumbers = "TextField" and format its result as number too. This will allow the user to enter anything, but the calculation field will only contain the numbers and ignore any characters (except a dash as a minus).

Posted

Yeah, I figured you would use that one. I've been working heavily on another project, so I decided to take the easy copy/paste/braindead route this time. laugh.gif

Posted

Well,

Seeing as qwerty' is listed as using 7, can we not use

Filter ( The Field To Filter ; "01234567890,.")

This could be placed on the field as an auto enter calc with the Do Not Replace Existing Value For Field (if any) turned off. Then, no matter what the user enters, the field will filter all extraneous data out.

Saves extra calc fields.

It's just a thought.

Posted

Indeed, FM7 makes this sort of thing much easier. The filter function could also be used as validation, in case there's need to prompt users to re-enter it correctly, rather than to assume that any numeric characters entered must be the right ones... (In some cases, if users enters data with letters included, it likely means they're not attending to the right data: Library of Congress number rather than ISBN, say...)

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