June 26, 200916 yr 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, 200916 yr by Guest
June 26, 200916 yr Why don't you trigger the script OnObjectModify, and make it: Set Field [ DisplayField ; Length ( Get (ActiveFieldContents) ) ]
June 26, 200916 yr 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?
Create an account or sign in to comment