// Permet d'ajouter un champ dans le formulaire d'ajout de candidats au CS
// Limite à 20 le nombre de champ maximum
function add_candidat(i) {
var i2 = i + 1;
document.getElementById('add_'+i).innerHTML = '
';
document.getElementById('add_'+i).innerHTML += (i <= 20) ? '' : '';
}
// Gestion du bonton On/Off
$(document).ready(function(){
$('#myonoffswitch').click(function(){
var myonoffswitch=$('#myonoffswitch').val();
if ($("#myonoffswitch:checked").length == 0) {var a=1;} else {var a="0";}
$.ajax({
type: "POST",
url: "inc/ajax.php",
data: "value="+a ,
success: function(html){
$("#display").html(html).show();
}
});
});
});
$(document).ready( function(){
$(".cb-enable").click(function(){
var parent = $(this).parents('.switch');
$('.cb-disable',parent).removeClass('selected');
$(this).addClass('selected');
$('.checkbox',parent).attr('checked', true);
});
$(".cb-disable").click(function(){
var parent = $(this).parents('.switch');
$('.cb-enable',parent).removeClass('selected');
$(this).addClass('selected');
$('.checkbox',parent).attr('checked', false);
});
});
// Gestion du popup de suppression des mots de passe
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 100
},
hide: {
effect: "explode",
duration: 100
}
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
});
});