Logique de soumission des valeurs
This commit is contained in:
parent
b735a072e5
commit
c68f72fcb2
@ -1,10 +1,10 @@
|
||||
<div>
|
||||
<p>
|
||||
<label>Etablissements :</label>
|
||||
<select name="Entreprise[Etablissements]">
|
||||
<option value="">Tous</option>
|
||||
<option value="">Actifs</option>
|
||||
<option value="">Inactifs</option>
|
||||
<select class="criteres" name="Entreprise[Etablissements]">
|
||||
<option value="null">Tous</option>
|
||||
<option value="1">Actifs</option>
|
||||
<option value="0">Inactifs</option>
|
||||
</select>
|
||||
</p>
|
||||
<p><label>Type d'établissements</label>
|
||||
@ -14,7 +14,7 @@
|
||||
<option value="">Uniquement les secondaires</option>
|
||||
</select>
|
||||
<p>
|
||||
<label>Avec Téléphone</label><input type="checkbox" name="Entreprise[tel]"/>
|
||||
<label>Avec Téléphone</label><input class="criteres" type="checkbox" name="Entreprise[tel]"/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<div id="comptage">
|
||||
Nombre d'entreprises sélectionnées :
|
||||
<span>0</span>
|
||||
<span id="count">-</span>
|
||||
</div>
|
||||
|
||||
<div id="critères">
|
||||
|
@ -1,12 +1,40 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#tabs').delegate('.criteres', 'click change', function(e){
|
||||
$('#tabs').delegate('select.criteres', 'change', function(e){
|
||||
e.preventDefault();
|
||||
var value = $('form[name=ciblage]').serialize();
|
||||
alert($(this).attr('name') + ' = ' + $(this).val() );
|
||||
|
||||
e.stopPropagation();
|
||||
alert($(this).attr('name') + ' = ' + $(this, ':selected').val() );
|
||||
set($(this).attr('name'), $(this, ':selected').val());
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#tabs').delegate('input[type=checkbox].criteres', 'click', function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
alert($(this).attr('name') + ' = ' + $(this).val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#tabs').delegate('input[type=radio].criteres', 'click', function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
alert($(this).attr('name') + ' = ' + $(this).val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#tabs').delegate('input[type=text].criteres', 'blur', function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
alert($(this).attr('name') + ' = ' + $(this).val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function set(key, value)
|
||||
{
|
||||
$.post('/comptage', { cle:key, valeur:value}, function(data, status) {
|
||||
$('#count').html(data.count);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user