I want to get out of focus from Button.

Participant ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

There is a button in the field.
When I focus on that button, a warning dialog will appear.


If I click <OK>, I can enter the event of releasing the mouse button.

 

The problem is from here.

When I do <cancel>, but the button even stays in focus.

I searched for a way to remove it automatically, but I can't find it.


For example, I tried the following, but it doesn't work.

 

var ButtonA = this.getField ("Button_A");
ButtonA.blur = false;

TOPICS
How to, JavaScript, PDF forms

Views

238

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
community guidelines
Adobe Community Professional ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

Did you create this form? Can you post it here?

 

BTW: there is not "field.blur" property. Please use to Acrobat JavaScript Reference when scripting in Acrobat. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Thank you for your reply. I had read the Acrobat JavaScript Reference before asking this question. I've found that some of the operations on the media player have methods that allow to control the focus.

I'm sorry, but I'm not very good at English. Such complex references quite time consuming to read. And even if I already read it all, I'm worried every time and whether I am understand everything.

So I post it. Please understund.

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
community guidelines
Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

LATEST

By the way, I can not see the page that you taught for me. Because I live in China. It looks like this: 

キャプチャ.JPG

Fortunately I found a very old reference PDF. And I am studying while reading it. Curiously, I can only access this page, but most of the overseas homepages that describe PDFs are not accessible from China.

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
community guidelines
Adobe Community Professional ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

As far as I know, there is not a way via JavaScript to set the focus to nothing. You can set the focus to a field that doesn't have a visible appearance and no actions though, using the field.setFocus method.

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
community guidelines
Most Valuable Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Maybe using setFocus on a hidden field will achieve the desired results... I haven't tested it, though.

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
community guidelines
Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Thank you for your reply. This button operation is mouse only. Looking at the advice of others, I realized that PDF is not possible. I will continue to write questions from time to time. Please give me some advice at that time as well.

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
community guidelines
Adobe Community Professional ,
Mar 13, 2021 Mar 13, 2021

Copy link to clipboard

Copied

What action does you use at the On Blur event of the button?

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
community guidelines
Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Thank you for your reply. I just wanted to remove the focus from the button (on field) after as soon as user pressed the cancel button that I placed in the dialog. Please give me some advice at that time as well.

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
community guidelines
Adobe Community Professional ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

"When I focus on that button"

Using the mouse or the keyboard?

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
community guidelines
Participant ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

Thank you for your reply. This button operation is mouse only. Looking at the advice of others, I realized that PDF is not possible. I will continue to write questions from time to time. Please give me some advice at that time as well.

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
community guidelines