Skip to main content
MADink_Designs27
Inspiring
March 26, 2020
Answered

Remove Field Event with JavaScript

  • March 26, 2020
  • 2 replies
  • 2631 views

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?

This topic has been closed for replies.
Correct answer try67

No.

2 replies

Inspiring
March 26, 2020

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.

MADink_Designs27
Inspiring
March 26, 2020

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.

try67
Community Expert
Community Expert
March 26, 2020

Yes, the documentation is incorrect about this. This method does work in Reader (at least XI, didn't test it in DC).

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 26, 2020

No.

MADink_Designs27
Inspiring
March 26, 2020

Thanks for the info!