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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s