Skip to main content
Participating Frequently
December 4, 2020
Answered

Hiding the submit button until all required fields are filled out

  • December 4, 2020
  • 2 replies
  • 2955 views

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.

This topic has been closed for replies.
Correct answer Nesa Nurani

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

2 replies

try67
Community Expert
Community Expert
December 4, 2020

Also, where did you place the code you used?

Participating Frequently
December 4, 2020

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

Bernd Alheit
Community Expert
Community Expert
December 4, 2020

What have you tried?

Participating Frequently
December 4, 2020

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;
}

 

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
December 4, 2020

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