Update field via JS before submitting data
Posted: Wed Feb 25, 2015 9:04 am
I want to update a field via Javascript in my program just before submitting the information to the RPG program.
The updated field should contain the ID of the display field that last received input.
The problem is, when I use the onsubmit() event of the Record of the Displayfile, the javascript seems to be activated after the data was submitted. So with the next exfmt of my record, the field is empty again.
So instead of the onsubmit() event of the record, I use the onfocus() event of every field in the display now.
It works, but I do not like that I have to add this one line JS to everything in my Display.
Is there a way I can update the field with the ID of the Display field that currently has the focus without adding the JS to every onfocus() event on the screen?
The updated field should contain the ID of the display field that last received input.
The problem is, when I use the onsubmit() event of the Record of the Displayfile, the javascript seems to be activated after the data was submitted. So with the next exfmt of my record, the field is empty again.
So instead of the onsubmit() event of the record, I use the onfocus() event of every field in the display now.
It works, but I do not like that I have to add this one line JS to everything in my Display.
Is there a way I can update the field with the ID of the Display field that currently has the focus without adding the JS to every onfocus() event on the screen?