Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make sure there's no commas in a text field?

Featured Replies

I want to set up a validation by calculation that will check to see if the user has entered a comma in a text field. I'm having no luck doing this.. can it be done? If so can someone help me out here?

Thanks!

Have a look at the filter function. That may help

Phil

You can have an Auto-Enter calculation on the text field. Be sure to uncheck 'Do Not Replace Existing Value for Field...). The calculation would be simple:

Substitute ( thisField ; "," ; "" )

This will simply remove them. Why bother a User with a validation error when FM is bright enough just to zap those commas from the universe? :wink2:

LaRetta

Hi,

What you want to do if a comma is found will dictate which way is best. However, the patterncount function can be used to count the # of commas, the position function can be used to tell where in the string the comma occurs, the replace function or the substitute function can be used to replace the comma with a space.

If you do not want to allow a comma to be entered then place this calculation in the validate by calculation ....

If not (patterncount(fieldname,","))

Should do the trick.

Hope this helps,

Tim

I concur with Laretta that you should just use a substitute to remove those commas. Once the field becomes comma free then you can use the number formatting option to allow commas for diplay purposes.

  • Author

Awesome guys. I figured the substitute thing out from a quick search on yahoo. Works great. I swapped the comma for a dash. Figure it would serve the same purpose.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.