Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How to check the my_check_box_1?

Avatar

Level 8

Hello

I have couple of check boxes on my form, like....... my_check_box_monthly....... my_check_box_yearly.

I have 2 scenarios, so based on scenario, i hv to select either of the check box, as below

if scenario_1

check the my_check_box_monthly

else if scenario_2

check the my_check_box_yearly.

endif.

Pls. let me know How to write check the check box (my_check_box_daily) in Java Script?

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 2

Try this code,

if scenario_1

{

my_check_box_monthly.rawValue = "1";//Assigning "1" will check and "0" willl uncheck

my_check_box_yearly.rawValue = "0";

}

else if scenario_2

{

my_check_box_yearly.rawValue = "1";

my_check_box_monthly.rawValue = "0";

}

Thanks,

Anitha

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

Try this code,

if scenario_1

{

my_check_box_monthly.rawValue = "1";//Assigning "1" will check and "0" willl uncheck

my_check_box_yearly.rawValue = "0";

}

else if scenario_2

{

my_check_box_yearly.rawValue = "1";

my_check_box_monthly.rawValue = "0";

}

Thanks,

Anitha