I have an INPUT, I try to automatically register when the focus is on it. By making focus sent a message to ask if you are sure to record the current date (could be a mistake finger) and here is my problem, because the message is repeated 2 times and do not understand why. The message I show with the JQUERYCONFIRM plugin.
$('.fecha').on('focus',function() {
var hoy = new Date();
var dia = hoy.getDate();
var mes = hoy.getMonth()+1;
var año = hoy.getFullYear();
if(dia<10) {dia='0'+dia;}
if(mes<10) {mes='0'+mes;}
hoy = año + '-' + mes + '-' + dia;
//$(this).val(hoy);
$.confirm({
theme: 'material',
title: 'Atencion',
content: '¿Ingresar Fecha?',
useBootstrap: false,
boxWidth:'300px',
buttons:{
Adelante: function(){ ingresarFecha() },
Cancelar: function(){}
}
});
});