Jump to content
Server Maintenance This Week. ×

Using script triggers to "tab" to a different field


revjj

This topic is 824 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a layout with four fields.  Two are auto enter fields, one is a field for notes.  It is activated by a script trigger to automatically go to that field.  I want to use a "OnExit" script trigger to move to another field after I enter data into the notes field.  Seems pretty straight forward but it does not work.  The field I want to move to is not locked and I am not in find mode.

Thanks again.

Link to comment
Share on other sites

16 minutes ago, revjj said:

Seems pretty straight forward but it does not work. 

"Does not work" is not a useful description. Show us your script and tell us what actually happens, as opposed to what do you expect to happen. Without this all you will get are guesses.

I don't like to guess, but I will point out that the OnObjectExit script trigger runs the triggered script before processing the triggering event. If you do not exit the script with a False result, the event will be processed after the script has run. So for example, if the user has exited the field by clicking on the background, the script will run and place the focus in the "other" field. Then the triggering mouse click will be executed and the final result will be that no field is selected.

BTW, your title says 'to "tab" to a different field'. Wouldn't actual tabbing be a better solution? In your planned scenario, when a user exits the source field by clicking into some field other than your target field, they will be forcibly taken to the target field. As a user, I would find such behavior very annoying.

 

Link to comment
Share on other sites

"Does not work" refers to what I expect it to do.  Here is the field and the script trigger.

image.png.765cec217e6749f6cc6fcab6006aa04b.png

 

Here is the script it refers to.

image.png.a9f3a8b6aa140352b2d369edb60afca3.png

I would prefer the user to enter data into the field notes and then when exiting (however they do it, tabbing, pressing the enter key, clicking elsewhere) then the new active field would be whatever I choose.  Is that clear?

I prefer not to use the tab key to move between fields as when I do that as the other field I want to "tab" to also has a script trigger that moves to another function.

Link to comment
Share on other sites

No Steve, that wasn't working.  I have another field in the layout that uses the OnExit function and when ever I used the tab or enter to exit the first field to go to the second field, for some reason it would trigger the second field and move on to the next operation without letting me enter data.  I figured it out using the "false" test approach.  The instructions are not Intuitively clear but I now have it working.

 

Link to comment
Share on other sites

This topic is 824 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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