Hello Vanderlei,
Greetings from Syncfusion support.
Yes, you can use the button to show and hide the input password in TextBox component. You need to use the type property in textbox and set its value respect to the toggle button’s content. Kindly refer to the following code snippet.
@Html.EJS().TextBox("Password").Placeholder("Senha").FloatLabelType(FloatLabelType.Auto).Type("Password").Render()
<button id="Reveal">Show</button>
<script>
document.getElementById('Reveal').onclick = function () {
var textObj = document.getElementById("Password").ej2_instances[0];
var togglebtn = document.getElementById("Reveal");
if (textObj.type == 'Password') {
textObj.type = "Text";
togglebtn.textContent = 'Hide';
} else {
textObj.type = "Password";
togglebtn.textContent = 'Show';
}
};
</script> |
Let us know if you need any further assistance on this.
Regards,
Prince