Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Changing obj.access="readOnly" to User Enter - Required at run-time

Avatar

Former Community Member
I'm on day 2 of LiveCycle usage. Yesterday I figured out the GUI

components and today I'm working on scripting, so please forgive me if

I'm asking the obvious.



I'm experimenting with an employment application. I have a basic,

"Are you 18 or older? Yes/No If no, specify"



I have the specify object invisible by default and it becomes visible

if the 'No' is checked. I can't seem to figure out, via help files

and google, how to make the specify object required when 'No' is

checked and not required otherwise. Any pointers would be greatly

appreciated.



Below is my event code:



if (AgeYesNo == 1) then

AgeSpecify.presence = "invisible"

AgeSpecify = null

AgeSpecify.access = "readOnly"

elseif (AgeYesNo == 2) then

AgeSpecify.presence = "visible"

AgeSpecify.access = "open"

endif
1 Reply

Avatar

Former Community Member
This was answered on another forum:



"



To make the field required,

AgeSpecify.validate.nullTest="error"; or AgeSpecify.mandatory="error";



To make the field optional,



AgeSpecify.validate.nullTest="disabled"; or AgeSpecify.mandatory="disabled";



"