Looking for some assistance with enabling and disabling buttons based on two functions. The first function is a JavaScript function, while the second function triggers on another button click event. Currently, the buttons work as expected initially - Save button enabled and Register button disabled when the JavaScript function runs, then vice versa during the button click event. However, my issue arises during subsequent calls of the JavaScript function, where the previously set button states do not change. Any help or guidance on this would be greatly appreciated.
HTML:
<script type="text/javascript">
function exists()
{
document.getElementById("<%= but_Register.ClientID %>").style.visibility = "hidden";
document.getElementById("<%= btn_save.ClientID %>").style.visibility = "";
}
</script>
C# :
protected void btn_newrgstr_Click(object sender, EventArgs e)
{
but_Register.Visible = true;
btn_save.Visible = false;
}