57 lines
1.7 KiB
JavaScript
57 lines
1.7 KiB
JavaScript
// 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 = '<ul class="conf_global_form"><li><label class="bold" for="cs[]">Prénom et Nom du candidat</label><input class="conf_cs" type="text" name="CS[]" value="" id="" /></li></ul>';
|
|
document.getElementById('add_'+i).innerHTML += (i <= 20) ? '<div id="add_'+i2+'"><p><a href="javascript:add_candidat('+i2+')">Ajouter un autre candidat</a></p></div>' : '';
|
|
}
|
|
// 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" );
|
|
});
|
|
});
|