Does anyone know how to define an event programmatically for a form object using JavaScript? My example is this:
I am passing form fields to a validation function in a JavaScript object by calling scriptObj.addToValidation(this); from the field initialize event.
The field object is added to a JavaScript array so I can check for null values of potentially hundreds of fields with one block of code. What I also want to do is define the click and enter events for each object programmatically from the addToValidation(obj) function while iterating through the array. This way I wont need to add code in each field in the design view, my goal is to take as much code out of the form fields as possible and put it into a script object using an object-oriented approach.
A path I was looking down was trying to access the event by: fieldObject[i].event__change = ... If you print the event__change or event__enter to the javascript console you can see it is an XFAObject but I cant find any doco about these objects and dont know if Im on the right track.
Hopefully this makes sense, please talk to me LC gurus!!