Validate required fields upon clicking the signature field in LiveCycle Designer | Community
Skip to main content
March 28, 2025

Validate required fields upon clicking the signature field in LiveCycle Designer

  • March 28, 2025
  • 2 replies
  • 643 views

I am trying to figure out how to verify that all required fields are filled upon clicking the signature field. Currently, they are only being verified after the digital signature is added and the submit button is clicked.

 

Upon adding a digital signature, the form has you save it locally. We are finding that users are just emailing the saved signed copy rather than filling the required fields when the submit button is clicked.

 

I'm pretty new but am a quick learner.

 

Thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
March 30, 2025

Hi @makivelli,

Thank you so much for sharing the information; the use case that you have specified is vert much feasible. To implement the use case you will need to write a custom JS, which will be called on the pre-sumitt event of the button. The sole purpose for the button will be to go through all the fields in the forms and highlight if there are any fields which are mandatory and not filled. If they are able to find some fields, then the submit action will be terminated there and you can also highlight the field to allow users to understand why the action was terminated.

 

Please let me know if you need any additional information on the same.
Thanks

Pranay

radzmar
Level 10
April 3, 2025

You can use a script with a recursive function to collect all empty mandatory fields and cancel the submitting attempt if any is found. This can be executed in the preSubmit event for example.

//Recursive function to find all empty mandatory fields function checkMandatoryField(oNode, aList) { if (oNode.className === "field") { if (oNode.validate.nullTest === "error" && oNode.isNull) { aList.push(oNode.name); } } for (var i = 0; i < oNode.nodes.length; i += 1) { checkMandatoryField(oNode.nodes.item(i), aList); } } // Call function, first parameter is the name of the forms root element. checkMandatoryField(form1, aList = []); // If there are any fields founds if (aList.length > 0) { // Show a message xfa.host.messageBox("Please fill the following fields first:\n" + aList.join("\n")); // Cancel planned action xfa.event.cancelAction = true; }