Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

hidden mandatory fields -validation

Avatar

Level 2

I've been having a bit of bother for days now trying to get the validation on my form just right...

Can anyone advise why mandatory fields that are hidden (and set to 'disable' when hidden) might show up in the validation script when it's run?

To give you an idea, I have several hidden subforms which appear on selection of a drop down and certain fields within those subforms are set to mandatory when visible, however if you make the subform visible then hide it again it still shows as mandatory in the validation event.

any help would be very much appreciated...

Thank you

4 Replies

Avatar

Level 9

Hi,

You need to make those fields not mandatory when it's hidden.

Thanks,

Bibhu.

Avatar

Level 2

Thanks Bibhu,

I have set all fields to non mandatory when hidden, that was the easy part.

I need to figure out why the fields show as mandatory when you show then hide again - the validation script still seems to think they are mandatory (even although they are hidden and not)....

Avatar

Level 9

Hi David,

I guess you need to write the script to first make the field non mandatory then make it hidden. Instead of making it hidden and then making it non mandatory.

Thanks,

Bibhu,

Avatar

Level 2

Thanks Bibhu,

I'll give that a try, the script is quite long but I get your point I've set them as hidden then non-mandatory.

fingers crossed that's all it is.