1
On my website, I have an event query section. Within this section, I added a CANCEL EVENT button. When this button is clicked, it executes the following javascript function:
function cancelaEvento(val){
var valor = val;
if (confirm("Tem certeza que deseja cancelar o evento "+val+"?\nCaso deseje fazer alguma alteração, clique em Editar") == true) {
location.href = "http://meusite.com.br/consultaeventos/cancelar?valor="+valor;
}
}
But I wanted in the popup of confirm appeared YES and NO or instead of OK and CANCEL. How can I do this?
The standard dialog box cannot be customized in normal ways. It is always OK and CANCEL. Search by "javascript custom confirm" on google for alternative solutions.
– Daniel Omine
Exactly, an alternative is to use Jquery dialogs: http://jqueryui.com/dialog/#modal-confirmation. Or implement the own.
– BrTkCa
It seems that natively it is not possible, but a library can be used. http://stackoverflow.com/questions/18420935/javascript-custom-text-on-confirm-ok-cancel-button
– William Rodrigues