atlzbest Posted June 26, 2009 Posted June 26, 2009 (edited) 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 June 26, 2009 by Guest
comment Posted June 26, 2009 Posted June 26, 2009 Why don't you trigger the script OnObjectModify, and make it: Set Field [ DisplayField ; Length ( Get (ActiveFieldContents) ) ]
atlzbest Posted June 26, 2009 Author Posted June 26, 2009 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?
Recommended Posts
This topic is 5688 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 accountSign in
Already have an account? Sign in here.
Sign In Now