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.

Show a character count of a field?

Featured Replies

Guys,

I am having a brain freeze. I'm trying a simple thing as counting the number of characters in a field and displaying it..i've got FM Pro 10 Advanced, ive got a onKeyStroke trigger that fires the script..

the layout has 6-10 fields so i cant name the field,

ive tried

Length ( Get (ActiveFieldContents) ) ..no good

Length ( GetAsText (ActiveFieldContents) ) ..no good

and then assigning the value to

could someone tell what im missing here...

update: ok i solved that part...it was getting it correctly, i was using Set field to display it...changed it to InsertCalculatedResult and that works...but now i have another issue...if i press del, space, it fires off which makes sense but its getting in the way of just simply typing, editing in the field...

is there a cleaner approach where as the user is typing, a running character count is displayed...this is vital to the business.

thanks!

Edited by Guest

Why don't you trigger the script OnObjectModify, and make it:

Set Field [ DisplayField ; Length ( Get (ActiveFieldContents) ) ]

  • Author

that actually did the trick...it works perfectly on onObjectModify

the problem i am having now is how to put the focus back to the field where i was typing

so assuming i was typing in a field called Title and the character count was being displayed in Counter...Counter gets populated but it also steals the focus...i dont have named Layout Objects so i cannot use Go to Object

and that is not an option since i have approx 35 layouts where i need to implement this...none have named layout objects thanks to the previous developer..

is there any other way to give back the focus to the active field?

Set Field [] does not change the focus.

  • Author

wow..that was it...thanks a million!

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.