I need to do just that:
If the user clicks No, system closes the message and keeps the information on the screen.
On the screen there is a limpar
button and it calls the acaoLimpar()
function but without displaying a dialog, simply clears all fields. Now with this new rule, how do I put two buttons in a alert()
and do what is written? Below the acaoLimpar()
function:
function AcaoLimpar() {
$("#txt_dt_ref_inicial").val("");
$("#txt_dt_ref_final").val("");
$("#ddl_tipotabela").val("");
$("#txt_tabela").val("");
$("#txt_classificacao").val("");
$("#txt_grupo").val("");
$("#ddl_autorizacaoprevia").val("");
limparAutoComplete();
}
function limparAutoComplete() {
var arrayTemp = [];
sessionStorage.setItem("tabelas", arrayTemp);
sessionStorage.setItem("classificacoes", arrayTemp);
sessionStorage.setItem("grupos", arrayTemp);
CarregarGridTabela(arrayTemp);
CarregarGridClassificacao(arrayTemp);
CarregarGridGrupo(arrayTemp);
}
When running the code below it works, however it generates button OK
and Cancelar
and the rule should be: SIM
and NÃO
function AcaoLimpar() {
decisao = confirm('Deseja realmente limpar os dados?')
if (decisao) {
$("#txt_dt_ref_inicial").val("");
$("#txt_dt_ref_final").val("");
$("#ddl_tipotabela").val("");
$("#txt_tabela").val("");
$("#txt_classificacao").val("");
$("#txt_grupo").val("");
$("#ddl_autorizacaoprevia").val("");
limparAutoComplete();
}
else
return false;
}
Using confirm
, how can OK
be changed by Sim
and Cancelar
by Não
?
Following the example of colleague TobyMosque, I did this, but my browser is old. Everything must be validated from IE 7. It gave error in the past includes. Does not accept attrProp
.
function AcaoLimpar() {
alert(1);
var msgExcluir = $("#msgExcluir");
msgExcluir.dialog({
modal: true,
buttons: {
"Sim": function () {
//alert("Excluido com Sucesso");
$("#txt_dt_ref_inicial").val("");
$("#txt_dt_ref_final").val("");
$("#ddl_tipotabela").val("");
$("#txt_tabela").val("");
$("#txt_classificacao").val("");
$("#txt_grupo").val("");
$("#ddl_autorizacaoprevia").val("");
limparAutoComplete();
$(this).dialog('close');
},
"Não": function () {
return false;
$(this).dialog('close');
}
}
});
}