AEM form required field check (Examples of Common Scripting Tasks)
- December 13, 2023
- 1 reply
- 1295 views
I am trying to implement the mandatory field test using 'mandatory' or 'nullTest' properties by following the example in the official site here.
I have a textfield, and a button. On the button click event I have the below code
TextField1.mandatory = "error"
TextField1.mandatoryMessage = "this field is mandatory!"The expected behavior is to highlight the text field if it is empty and display the mandatory message. However, I've encountered an issue where, on the first button click, the message is not immediately visible. It only becomes visible on the second click.
I am using AEM Form v6.5 (128 bit), and I'm wondering if this behavior is related to specific settings. Could someone kindly advise on why the mandatory message might not be visible on the first click? Your assistance is greatly appreciated.
Attached the PDF form for your reference.
Thanks.