Copy link to clipboard
Copied
Is it possible to remove an event from a field with JavaScript?
I used the setAction(); method to create OnFocus and OnBlur events on an array of fields to create an auto text size attribute, but there are some use cases of the form that require the event to be removed. The code is a doc level function and triggered by a combobox.
I wasn't able to find any documentation in the SDK for my issue.
I was able to get it to work the way I wanted by making the events blank based on combobox selection such as (fieldName.setAction("OnFocus", " ");), but I feel that's more of a workaround. Is there a better solution?
No.
Copy link to clipboard
Copied
No.
Copy link to clipboard
Copied
Thanks for the info!
Copy link to clipboard
Copied
Does this PDF have to work with Reader? Changing the document with setAction is fine for creating the form, but not when using it, and it won't work with Reader.
Copy link to clipboard
Copied
It does. I just tested it with Reader and didn't have an issue.
The form is for Avery Labels and consists of a cover page that will spawn page templates based on combo selection. The selection choice will also change the content of the OnFocus and OnBlur events.
It's an internal form, so this test is based on the latest version of Reader.
I've never really been keen on designing for compatibility when the software is free.
Copy link to clipboard
Copied
Yes, the documentation is incorrect about this. This method does work in Reader (at least XI, didn't test it in DC).