Date fields have inconsistent behavior when setting ReadOnly

Product Version: WebViewer 7.3.1

Please give a brief summary of your issue:
I am using the WebViewer to load a PDF document, which allows users to select fields (not for data entry, just simply click on them). We have attached an event listener to the ‘mousedown’ event, so when the user clicks on the field, we can tell them more information about the field that they have selected.

The behavior here is very much like a “designer”, or like in Adobe Acrobat where you can Edit Form Fields, instead of Edit Document Contents. Since we are editing form fields and not editing document content, we don’t want the field’s data entry behavior in the WebViewer, so after we load the document, we set the field(s) as ReadOnly

This works great for all fields except Date fields. And what I am seeing is inconsistent.

When I set the ‘ReadOnly’ flag on a field that is a Date, most of the time what is rendered in the HTML DOM is:

<input type="text" readonly....

however, sometimes I am seeing:

<input type="text" readonly disabled="disabled"....

that addition of disabled="disabled" is causing the widget/field not to be clickable, so the ‘mousedown’ event that I have attached to the field doesn’t fire.

I realized I’m using an older version, so I’m looking into possibly upgrading to 8.9.0, but I was wondering if anyone had seen this type of behavior before when setting the ‘ReadOnly’ flag on a date field.

In this circumstance, the document I’m using is 6 pages long and has close to 100 form fields on it, including about 15 date fields. Most of the date fields render correctly, but I have a handful that consistently are rendering with the disabled="disabled" attribute on the rendered textbox, which is breaking my desired behavior.

Thanks!
-Brian

Hi Brian,

As you said I would recommend upgrading to the latest version (8.10.0). However in the meantime to help debug this issue could you attach the PDF that you’re having this problem with?

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.

Hi @zserviss ,

The file I am using is here:

What I am finding is that when I use FieldManager to look over each field, and set the fieldFlag of ‘ReadOnly’ to true, that the 2 date fields on page 4 render as <input type="text" readonly disabled="disabled". The other date fields on page 3 do not render with the “disabled” attribute, so I can click on them and fire the field’s widget ‘mousedown’ event.

-Brian

Hi Brian,

Thanks for the file. I just tested this file in 8.9.0 (sorry to confuse you earlier, 8.10.0 isn’t released until next week) and was able to interact with the date fields on page 4.

I would recommend upgrading to 8.9.0 as it seems to be fixed in that version.

Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.