Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Make the textfield mandatory

Avatar

Level 2

Good day to all

I'm trying to make text fields mandatory while having a rawValue. I know that mandatory works only if the field is empty. I tried the code that will make the field empty when clicked/entered but I want the error message to pop up after I exit the field or after I save the form. Also, the fields have a validation (e.g., date, time and phone number). I also need the field be mandatory IF the previous field is filled in.

 

One more, is there any way to make signature field mandatory? I tried the invisible field method but I can't make it work. My form have multiple signature fields and doesn't have a submit button

 

Here's the sample row in my form

Name                 Phone number       Signature             Date                  Time

___________     (000) 000-0000     ____________     YYYY/MM/DD   00:00 AM

Can anyone help me on this one? Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

If you mean that your text fields have a value because you have assigned them "(000) 000-0000" or the like, then you may want to use a null display pattern.

So a display pattern of:

null{'(000) 000-0000'}

will have the same effect, but the mandatory test will still work.

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

If you mean that your text fields have a value because you have assigned them "(000) 000-0000" or the like, then you may want to use a null display pattern.

So a display pattern of:

null{'(000) 000-0000'}

will have the same effect, but the mandatory test will still work.

Regards

Bruce

Avatar

Level 2

Thanks Bruce for the hint

 

I put null{}|text{'('999')' 999-9999} in the display pattern

Edit: Now I know what is "Allow Empty" is for