maheshforum Posted October 13, 2007 Share Posted October 13, 2007 Hi, I want to create the confirm dialog box with "OK" and "Cancel" button. When clicking the ok button I need to return "TRUE", If I click the "Cancel" I need to return "false". Is any possibilities to do thisregards,Maheshwaran Devaraj Link to comment Share on other sites More sharing options...
Synook Posted October 13, 2007 Share Posted October 13, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.