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.

Featured Replies

Howdy, all:

I'm trying to create a script trigger so when a user enters lowercase text into a two-letter State (text) field FMP will change the text to uppercase.

The problem is users will unconsciously enter the state's identifier in lowercase so it'll "stick" in the field instead of the uppercase ones already set up in the value list. I don't want to change the field to a pop-up menu since that'll be unsightly and unwieldy with such a long list (states plus US possessions and Canadian provinces.) Before tweaking, I had it set up so the user received a custom dialogue message that he or she should use only uppercase letters but that was kinda clunky; I'd rather have FMP automate the change. I tried using the command, Upper, by itself but it "masks" the text to look like uppercase--the original text remains in lowercase.

I'm close but not quite there. (See the attached) The first letter is changed after I enter the second letter of the two-letter abbreviation but the second letter isn't changed unless I enter a third letter. Not good. What do I need to tweak the script so the second letter is automatically capitalized?

Pee Ess: I thought of using OnObjectModify instead of OnObjectKeystroke but since there's a tab order set up in the layout what happens is that the following field's (ZIP code) text is changed to the State's text. Not good, either!

TIA for your help.

test.fp7.zip

Your script never exits as false - so the keystroke is eventually passed to the field. However, this happens AFTER the script has run. At the time you re-insert the field's contents, it's all the characters you have typed so far - NOT including the captured keystroke.

Wouldn't it be simpler to auto-enter a correcting calculation?

Try this file, I used a simple custom function to make it uppercase

Howdy, all:

I'm trying to create a script trigger so when a user enters lowercase text into a two-letter State (text) field FMP will change the text to uppercase.

The problem is users will unconsciously enter the state's identifier in lowercase so it'll "stick" in the field instead of the uppercase ones already set up in the value list. I don't want to change the field to a pop-up menu since that'll be unsightly and unwieldy with such a long list (states plus US possessions and Canadian provinces.) Before tweaking, I had it set up so the user received a custom dialogue message that he or she should use only uppercase letters but that was kinda clunky; I'd rather have FMP automate the change. I tried using the command, Upper, by itself but it "masks" the text to look like uppercase--the original text remains in lowercase.

I'm close but not quite there. (See the attached) The first letter is changed after I enter the second letter of the two-letter abbreviation but the second letter isn't changed unless I enter a third letter. Not good. What do I need to tweak the script so the second letter is automatically capitalized?

Pee Ess: I thought of using OnObjectModify instead of OnObjectKeystroke but since there's a tab order set up in the layout what happens is that the following field's (ZIP code) text is changed to the State's text. Not good, either!

TIA for your help.

trial.zip.zip

  • Author

Ah, thank you both!

If there's one thing that's constant in the universe it's that I will find the most complicated, Rube Goldberg-ish way of constructing a calculation or script.

Oh well, everybody has a skill...

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.