Hide change button in Azure B2C Verification DisplayControl

We have a readonly text box in which we can prepopulate an email address. We can send a code to that address and verify it using a display control. When the user completes the verification process, a “Change” button is displayed. Since the text box is readonly, the user cannot change the email.

We need to know how to hide the “Change” button in the display control dynamically.

To hide the “Change” button in the display control dynamically, you can create a boolean variable in your code to track whether the verification process has been completed or not. Then, you can bind the visibility property of the “Change” button to this variable using conditional logic.

For example, in C#:

bool verificationComplete = false;

// Code to handle verification process and set verificationComplete to true

changeButton.Visible = verificationComplete;

In JavaScript:

let verificationComplete = false;

// Code to handle verification process and set verificationComplete to true

document.getElementById("changeButton").style.display = verificationComplete ? "block" : "none";