Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

null tests and validation


Former Community Member

I have a question regarding null tests and preprint validation script. I have perfect script for form validation on the preprint event and null tests on text fields in the form. My form has a text field captioned "Part Number:" and right next to the part number is another text field captioned "N/A, Justify:". If the user does not have a part number, it has to be justified and the "N/A, Justify" field is now required prior to submission. My null test is on the Part number object in an enter event. My script is as follows:

if ((this.resolveNode("$").rawValue == null || this.resolveNode("$").rawValue == "")) {

  1. NA.validate.nullTest= "error";

} else {

NA.validate.nullTest = "disabled";


  All would work just fine except that  LiveCycle wants the null test to be on the enter/exit event of a text field. My problem is that users can scroll through the form filling it out accordingly and may accidentally not enter or exit the part number field thus not running the null test. What are my options to run a null test in an event with text fields? Obviously entering and exiting aren't always happening. I tried changing the cursor focus on the next field but that didn't help either because it didn't allow the user to go back to any previous field to make corrections due to the cursor always jumping to the next field. Can you help? Thank you so much!!!

0 Replies