Page type Field Controls

Mb _Krishna asked on April 1, 2017 07:08

I need to disable a field in page type form based on certain criteria. for instance I need to get control of a checkbox from page form section and disable it from code ? Is there a way to access those page type controls in code?

Recent Answers


Jan Hermann answered on April 1, 2017 11:42

Yes, you can put custom macro method to the Visible property of that field and the macro runs the C# code in your macro method.

0 votesVote for this answer Mark as a Correct answer

Mb _Krishna answered on April 1, 2017 11:59

Thanks Jan, But is there any way I can dynamically change value of page type field ? Like, dynamically change value of checkbox based on certain condition ?

0 votesVote for this answer Mark as a Correct answer

Amit Srivastava answered on April 3, 2017 08:15

Hi Krishna,

Create a field with Boolean data type and check Has Depending Fields check box at bottom section and create another field with required data type and check depends on another field check box and mention a visibility condition "checkboxFieldName.value == true". I think it can solve your problem.

Cheers,

2 votesVote for this answer Mark as a Correct answer

Mb _Krishna answered on April 3, 2017 08:57 (last edited on April 3, 2017 08:58)

Hi Amit, I got the point of using visibility and enabling fields using macros as they are provided by kentico . What I'm seeking is to toggle that checkbox between checked and unchecked not changing visibility or Enable. Dynamically change the checkbox from unchecked to checked based on another field value. Is there any way we can do this ?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.