1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| $( "#dialog-form" ).dialog({
autoOpen: false,
height: 520,
width: 400,
modal: true,
buttons: {
"Créer un compte": function() {
/*var bValid = true;
allFields.removeClass( "ui-state-error" );
bValid = bValid && checkLength( nom, "nom", 2, 20 );
bValid = bValid && checkLength( prenom, "prenom", 2, 20 );
bValid = bValid && checkLength( adresse, "adresse", 5, 40 );
bValid = bValid && checkLength( code_postal, "code_postal", 3, 16 );
bValid = bValid && checkLength( ville, "ville", 5, 16 );
bValid = bValid && checkLength( telephone, "telephone", 5, 16 );
bValid = bValid && checkLength( email, "email", 6, 80 );
bValid = bValid && checkRegexp( nom, /^[a-z]([0-9a-z_])+$/i, "Le nom of a-z, 0-9, underscores, begin with a letter." );
bValid = bValid && checkRegexp( prenom, /^[a-z]([0-9a-z_])+$/i, "Le prenom may consist of a-z, 0-9, underscores, begin with a letter." );
bValid = bValid && checkRegexp( adresse, /^[a-z]([0-9a-z_])+$/i, "l'adresse may consist of a-z, 0-9, underscores, begin with a letter." );
bValid = bValid && checkRegexp( code_postal, /^([0-9])+$/, "Le mote de passe field only allow : 0-9" );
bValid = bValid && checkRegexp( ville, /^[a-z]([0-9a-z_])+$/i, "La ville may consist of a-z, 0-9, underscores, begin with a letter." );
bValid = bValid && checkRegexp( telephone, /^([0-9])+$/, "Le telephone field only allow : 0-9" );
bValid = bValid && checkRegexp( email, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "eg. ui@jquery.com" );
*/
/* if ( bValid )
{*/
$( "#users" ).append( "<tr>" +
"<td>" + nom.val() + "</td>" +
"<td>" + prenom.val() + "</td>" +
"<td>" + code_postal.val() + "</td>" +
"<td>" + ville.val() + "</td>" +
"<td>" + telephone.val() + "</td>" +
"<td>" + email.val() + "</td>" +
"<td>" + groupe.val() + "</td>" +
"</tr>" );
//var data = $("#dialog-form > form" ).serialize();
//alert (data);
$.ajax({
type: "POST",
url: "/modules/emails.php",
data: $("#dialog-form form" ).serialize(),
success: function(msg){
alert( "Data Saved: " + msg );
info_good("Le nouveau contact a bien été crée");
}
});
$( this ).dialog( "close" );
/* }*/
},
Annuler: function()
{
$( this ).dialog( "close" );
}
}, |