Jump to content

create custom Confirm Dialog


maheshforum

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...