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.

radio button script for Livecycle static form

Avatar

Level 1

On my static Livecycle PDF form, I have a radio button group called Entry_type with 2 options. If option 1 is selected, I want another radio group called T_shirt to be not available. If option 2 is selected I want T-shirt to be mandatory. I want to validate these actions before the form can be emailed or saved.

I am a coding novice and have tried various scripts but they are not working. Here is my last attempt:


----- Form.Page1.Entry_type::click: - (JavaScript, client) -----------------------------------------

if (this.rawValue == 2){

  T_shirt.validate.nullTest = "error";

 

if (this.rawValue == 1){

   T_shirt.validate.nullTest = "disabled";

}

----- Form.Page1.Entry_type.Basic::click: - (JavaScript, client) -----------------------------------


Could someone help me with a correct Javascript or Folmcalc script?

Much appreciated.

Regards - Maggie

2 Replies

Avatar

Level 2

Hi,

Please try the below code

if(this.rawValue == "2")

{

T_shirt.presence = "visible";

T_shirt.mandatory = "error";

}

else

{

T_shirt.presence = "hidden";

}


Regards,

Sony

Avatar

Level 1

Thanks Sonya. I still could not get the script working but I appreciate your suggestion. I think I will try another tack. Regards Maggie