Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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

Avatar

Level 2

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.

1 Reply

Avatar

Level 7

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.


}