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.

Help with script

Avatar

Level 7

I have 3 DDLists(User Enter Required):

List_A

Items:A, B, C

Value:1, 2, 3

List_B

Items:D, E, F

Value:1, 2, 3

List_C

Items:G, H, K

Value:1, 2, 3

For a Button on Click Event I try to make a Field Visible if all the above Lists are Fill ln - LIKE a validation!

I have try the script below without any lack!

if  ((form1.Page1.List_A.rawValue<0) && (form1.Page1.List_B.rawValue<0)  && (form1.Page1.List_C.rawValue<0)
     )

{
Field.presence = "invisible";

}

else

{

Field.presence = "visible";

}

I will appreciate any Help

Thank you

3 Replies

Avatar

Former Community Member

The script looks fine  .....did you save the form as dynamic?

If yes hit Ctrl-J in Acrobat and see if any javascript errors are generated.

Paul

Avatar

Level 4

Wouldn't the "<0" in the script never be true? Maybe try this revised script:

if  ((form1.Page1.List_A.rawValue>0) &&  (form1.Page1.List_B.rawValue>0)  &&  (form1.Page1.List_C.rawValue>0))

     {
     Field.presence = "visible";

     }

     else

     {

     Field.presence = "invisible";

     }

Jo

Avatar

Level 7

Here is my solution:

if  ((form1.Page1.List_A.rawValue==null) || (form1.Page1.List_B.rawValue==null)  || (form1.Page1.List_C.rawValue==null)
     )

{
Field.presence = "invisible";

}

else

{

Field.presence = "visible";

}

Thanks everyone for your help