In my ASP.NET web app, I have a linkbutton. If the user clicks it I wanted to use javascript to prompt the user to type in a certain value. If they type it in exactly then I will call the click event on the ASP.NET linkbutton.
The javascript would display a message like this: "Type DELETE in the textbox below to delete all data." If they type in DELETE (exactly) then I would run the click event of the asp:button. A small snippet to give you an idea of the logic....
var resp = prompt("Enter DELETE (all caps) to delete", "");
if (resp == null || resp == "") {
alert( "Cancelled.");
} else {
if (resp == 'DELETE') {
alert("Run the link button code");
} else {
alert("Cancelled.");
}
}
Any ideas how I can do this?
I know how to do a standard confirm. In the linkbutton I do something like this....
OnClientClick="return confirm('Are you sure you want to do this?');"
I basically want to do the same thing but with a prompt.