Handling Conditional Visibility/dependency in Kentico 13 FormBuilder

Kaur Navneet asked on August 8, 2024 08:33

Hi I am working with Kentico 13 and using the FormBuilder for form layout. In Kentico 11, I could use 'Field advanced settings' to apply visibility conditions directly. However, with Kentico 13, I don’t see a similar option. I need to show or hide the 'Age' field based on the value of the 'Street' field. How can I achieve this without using the 'Fields' settings? Any guidance or best practices would be appreciated!

@await Html.Kentico().FormZoneAsync("Name") @await Html.Kentico().FormZoneAsync("Street") @await Html.Kentico().FormZoneAsync("Age") @await Html.Kentico().FormZoneAsync("ZipCode")

Now I need to add Visibility condition: Street.Value.Contains("Yes") than Age Field Show/depend. How does it work without Fields

Image Text

Recent Answers


Jamie Leask answered on August 20, 2024 21:01

Hi Kaur,

Since natively through the UI kentico will only show condition options for int and checkbox values, you would need to create your visibility condition rule inside the project like shown here https://docs.kentico.com/13/developing-websites/form-builder-development/defining-field-visibility-conditions#defining-depending-visibility-conditions

0 votesVote for this answer Mark as a Correct answer

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