Remove Field Event with JavaScript

Contributor ,
Mar 26, 2020

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No.

TOPICS
Acrobat SDK and JavaScript, Create PDFs, PDF forms

Views

1.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Remove Field Event with JavaScript

Contributor ,
Mar 26, 2020

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No.

TOPICS
Acrobat SDK and JavaScript, Create PDFs, PDF forms

Views

1.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 26, 2020 0
Most Valuable Participant ,
Mar 26, 2020

Copy link to clipboard

Copied

No.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 26, 2020 1
Contributor ,
Mar 26, 2020

Copy link to clipboard

Copied

Thanks for the info!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 26, 2020 0
Adobe Community Professional ,
Mar 26, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 26, 2020 1
Contributor ,
Mar 26, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 26, 2020 0
try67 LATEST
Most Valuable Participant ,
Mar 26, 2020

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 26, 2020 1