41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
$('#tabs').delegate('select.criteres', 'change', function(e){
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
set($(this).attr('name'), $(this, ':selected').val());
|
|
});
|
|
|
|
$('#tabs').delegate('input[type=checkbox].criteres', 'click', function(e){
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
set($(this).attr('name'), $(this).val());
|
|
});
|
|
|
|
$('#tabs').delegate('input[type=radio].criteres', 'click', function(e){
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
set($(this).attr('name'), $(this).val());
|
|
});
|
|
|
|
$('#tabs').delegate('input[type=text].criteres', 'blur', function(e){
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
set($(this).attr('name'), $(this).val());
|
|
});
|
|
|
|
});
|
|
|
|
function set(key, value)
|
|
{
|
|
$('#comptage').css('display', 'none');
|
|
$('#attente').css('display', 'block');
|
|
$.post('/comptage', { cle:key, valeur:value}, function(data, status) {
|
|
$('#count').html(data.count);
|
|
$('#insee').html(data.insee);
|
|
}, 'json');
|
|
$('#attente').css('display', 'none');
|
|
$('#comptage').css('display', 'block');
|
|
}
|
|
|