can i write custom confirm box in javascript.Instead of 'OK' and 'CANCEL' buttons i want to show 'SAVE' and 'DELETE' buttons.
+3
A:
Not with the native JavaScript confirm box. You could use one of the many JavaScript UI components that emulate modal dialogs to do this instead.
Here's an example: http://jqueryui.com/demos/dialog/modal-confirmation.html
I've never used this so use at your own risk.
Tim Down
2010-10-20 09:12:44
can you give one working example
OddOneOut
2010-10-20 09:13:35
A:
$('confirm text').dialog(
{
modal:true, //Not necessary but dims the page background
buttons:{
'Save':function() {
//Whatever code you want to run when the user clicks save goes here
},
'Delete':function() {
//Code for delete goes here
}
}
}
);
This should work, but you will need to download or link to jQuery and the jQuery UI libraries to run this.
Belinda
2010-10-20 09:47:38