NxTIC/view/js/input.js

35 lines
742 B
JavaScript

// Vérifiera les input
var ic = new inputChecker();
var fileInput = document.querySelector('input#call_log-import[type="file"]');
fileInput.addEventListener('change', function(e){
/* (1) On rédige la requête */
var uploadRequest = {
path: 'upload/call_log',
file: fileInput.files[0]
};
/* (2) On effectue l'upload (import) */
api.send(uploadRequest, function(response){
console.log( response );
});
}, false);
var number = document.querySelector('input.number[type="text"]');
ic.append(number, format_number, '06 06 06 06 06');
// format_number -> format pour les numéros de téléphones
number.addEventListener('keyup', function(e){
ic.correct(number, false);
}, false);