• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hiding the submit button until all required fields are filled out

Community Beginner ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

This should be pretty straight forward I think but I'm having a difficult time finding the correct answer for what I want.

I have six fields on a PDF form, I want the submit button to remain hidden until all six fields are not blank, then change to visible.

I've tried different IF AND statements and just not getting it to work. Using Adobe Acrobat DC. 

Thanks for advice.

TOPICS
Acrobat SDK and JavaScript

Views

1.8K

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

correct answers 1 Correct answer

Community Expert , Dec 04, 2020 Dec 04, 2020

Change " " to "" whitout space and change visble to visible.

Votes

Translate

Translate
Community Expert ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

What have you tried?

Votes

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
Community Beginner ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

In this one, I wanted a "results" field to display only when all 6 fields were field out. I tried something simliar for the button too. I have this code located in the Custom Calculation Script box in a hidden field since the "results" field has something else in it for displaying results.

var nameData = this.getField("Name").value;
var vehicleData= this.getField("Vehicle").value;
var premiumData = this.getField("Premium Increase").value;
var pmilesData = this.getField("Previous Miles").value;
var cmilesData = this.getField("Current Miles").value;
var dateData = this.getField("Renewal Date").value;

if(nameData != " " && vehicleData != " " && premiumData != " " && pmilesData != " " && cmilesData != " " && dateData != " "){
    this.getField("results").display = display.visble;
}
else {
this.getField("results").display = display.hidden;
}

 

Votes

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Change " " to "" whitout space and change visble to visible.

Votes

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
Community Beginner ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

LATEST

That's what I get for doing this late at night, can't believe I missed visble instead of visible. Thanks Nesa

Votes

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
Community Expert ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

Also, where did you place the code you used?

Votes

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
Community Beginner ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

I have this code located in the Custom Calculation Script box in another hidden field.

Votes

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