Skip to content

Commit

Permalink
Merge pull request #11853 from timvandermeij/acroform-names
Browse files Browse the repository at this point in the history
Include the name for interactive form elements
  • Loading branch information
timvandermeij authored Apr 27, 2020
2 parents d469b42 + 371e699 commit 8fb82e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
}

element.disabled = this.data.readOnly;
element.name = this.data.fieldName;

if (this.data.maxLen !== null) {
element.maxLength = this.data.maxLen;
Expand Down Expand Up @@ -545,6 +546,7 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
const element = document.createElement("input");
element.disabled = this.data.readOnly;
element.type = "checkbox";
element.name = this.data.fieldName;
if (this.data.fieldValue && this.data.fieldValue !== "Off") {
element.setAttribute("checked", true);
}
Expand Down Expand Up @@ -620,6 +622,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {

const selectElement = document.createElement("select");
selectElement.disabled = this.data.readOnly;
selectElement.name = this.data.fieldName;

if (!this.data.combo) {
// List boxes have a size and (optionally) multiple selection.
Expand Down

0 comments on commit 8fb82e9

Please sign in to comment.