Quick JavaScript Confirm Message Validator

For a quick and simple confirm message validator fire an OnClientClick event on the element required to validate. For instance on a delete link paste the following javascript call:

OnClientClick=”javascript:return confirm(‘Are you sure you want to Delete?’);”

This will display a pop up message giving yes or no as an option. If no is clicked, the click event is ignored, if yes is clicked, the click event is accepted.