Rev 3166 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
function nouveauChamps(html){var html ='<div>'+'<label for="nom_champs">Nom du champ</label>'+'<input type="text" value="Nom du Champs" id="nom_champs">'+'<label for="type_champ">Type de champ</label>'+'<select name="type_champ" id="type_champ">'+'<option value="text">Champ texte</option>'+'<option value="textarea">Champ rédaction</option>'+'<option value="select">Menu déroulant</option>'+'<option value="checkbox">Cases à cocher</option>'+'<option value="radio">Boutons radio</option>'+'<option value="date">Calendrier</option>'+'<option value="file">Téléchargement</option>'+'<option value="hidden">Caché</option>'+'<option value="button">Bouton</option>'+'</select>'+'<div>';$('#profile-details-fields-section').append(html);}function inputFileStyle() {// ajout de la classe JS à HTML$('html').addClass('js');// initialisation des variablesvar $fileInput = $( ".input-file" ),$button = $( ".label-file" ),$the_return = $(".file-return");// action lorsque la "barre d'espace" ou "Entrée" est pressée$button.on( 'keydown', function( event ) {if ( event.keyCode == 13 || event.keyCode == 32 ) {$fileInput.focus();}});// action lorsque le label est cliqué$button.on( 'click', function( event ) {$fileInput.focus();return false;});// affiche un retour visuel dès que input:file change// ...A voir ok=lus tard// $fileInput.on( 'change', function( event ) {// file = this.value();// $the_return.html( file );// });}jQuery(document).ready(function() {inputFileStyle()// var $projet = $('#projet');// $projet.on('change', function( event ) {// console.log($projet.val());// $.ajax({// url : 'http://localhost/widget:cel:manager',// type : 'post',// datatype : 'mode=creation&projet='+ $projet.val()// });// });$('#add_fields').on("click", function(){nouveauChamps();});});