I'm a little confused.
I have a flag that the user can click, which determines whether the personal phone number on my page should be visible to everyone or just for administration. When the box clicked, I want to make sure that you are allowed to first print the status of it only for testing purposes. And when I run this function, it runs twice.
I read somewhere else, what is it because of Callbacks? But I return False, so it should not be right?
I am not a JavaScript master, so there are many things that I still don’t know about JavaScript and its interaction with ASP.
function ValidateHidePrivate() { if (scope["pickeduser"] != scope["credential"]) { alert("Not allowed"); return false; } else { alert(document.getElementById("HidePrivate").checked); return false; } }
And HTML:
<label for="HidePrivate" onclick="ValidateHidePrivate()"> <input type="checkbox" name="HidePrivate" id="HidePrivate" value="no" /> Hide my Private Phone Number </label>
Any help?
javascript function html events asp.net-mvc
Omniowl
source share