Jump to content

create custom Confirm Dialog


maheshforum
 Share

Recommended Posts

JS confirm dialog boxes have boolean return values by default

response = confirm("This is a confirm dialog box");alert(response); //Will show true or false, depending on button pressed

If you want some other values to be returned, say the strings "TRUE" and "false", then you could create another function

function customconfirm(message) {	response = confirm(message);	if (response) {		return "TRUE";	} else {		return "false";	}}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...