Toggle the visibility of elements depending on the state of the switch button

When prompted ‘Do you have an Aadhar card?’ a switch button is provided to ascertain its availability. If the individual indicates possession of an Aadhar card by toggling the switch, the input field for entering the Aadhar number becomes visible; otherwise, it remains disabled. How can I achieve this functionality?

Certainly, here’s a step-by-step guide for your requirements:

  1. Drag and drop the switch button onto the canvas.

  2. Drag and drop the input field onto the canvas, which will be responsible for the visibile/Invisible state.

  3. Set the event on the OnSelect property of the switch button.

  4. Remember that the switch button returns a boolean answer in terms of ‘Y’ or ‘N’.

  5. Set the task to make the input field visible or invisible based on the switch button’s state.

  6. Set the Business Rule (BR) for the visibility of the input field as follows:

  7. If the value of the switch button == Static(Y,String), then the input field should be visible.

Set the Business Rule (BR) for the invisibility of the input field as follows:

  1. If the value of the switch button == Static(N,String), then the input field should be invisible.

Following these steps will ensure that the input field’s visibility is dynamically controlled based on the state of the switch button.