LiveCycle ES 2 - Disable Submit Button Until Required Field(s) Are Filled

ZumaDroid

02-03-2015

Hello!

Looking for some assistance with LiveCycle ES 2.

Current Form:

Form has 1 required field and submits the form via email with a submit button and a script on mouseDown to lock the form once the Submit button has been clicked.

Issue:

If the user forgets to the fill in the required field and clicks on the submit button, the entire form locks down and the end user cannot edit the form any more.

Requirements:

I need the ability to either prompt the user fill in the required field (text field) prior to continuing onward or disable the submit button until content has been filled in the required field.

Form can be provided if needed.

Accepted Solutions (0)

Answers (1)

Answers (1)

jasotastic81

17-03-2015

How about this?


var complete = true;



if (tfRequiredField.isNull) complete = false;


//add more lines for any other fields that are required here.



if (complete) {


  //whatever your script already does


}


else {


  //whatever you want to do to let the user know the field was left blank.


  //I would recommend a message box. That does the trick for us.


}