http://www.paris.fr/portail/accueil/Portal.lut?page_id=9913
|
// <![CDATA[ // <![CDATA[ $(document).ready( function() { $("#ligne1, #ligne2, #ligne3, #ligne4, #ligne5, #ligne6, #ligne7, #ligne8, #ligne9").bind('blur', function() { $(this).val(function(i, val) { return val.toUpperCase(); }); }); }); var timer; function sendvt() { myForm=$("#fp"); str=myForm.serialize(); if (control()) $.ajax( { type: "POST", data: str, url: myForm.attr("action"), success: function(retour) { alert('Votre proposition de message a été transmise.'); myForm[0].reset(); } }); } function control() { if ($("#prenom").val()=='') { alert('Veuillez préciser votre pr\351nom'); $("#prenom").focus(); return false; } if ($("#nom").val()=='') { alert('Veuillez préciser votre nom'); $("#nom").focus(); return false; } if ($("#courriel").val()=='') { alert('Veuillez préciser votre courriel'); $("#courriel").focus(); return false; } if ($("#Arrondissement").attr("selectedIndex")==0) { alert('Veuillez choisir votre arrondissement'); $("#Arrondissement").focus(); return false; } texte=''; for (j=1;j<9;j++){ ligne=$("#ligne"+j); if (ligne.val().length>20) { alert('La ligne '+j+' est trop longue'); return false; } ligne.val(ligne.val().toUpperCase()); texte+=ligne.val().replace(/^\s+/g,'').replace(/\s+$/g,''); } if (texte=='') { alert('Le message est vide !'); ligne.focus(); return false; } if (!$("#Submit_Form").is(':checked')) { alert('Veuillez accepter les conditions générales d\'utilisation'); $("#Submit_Form").focus(); return false; } return true; } $(document).ready( function() { tab=''; for (j=0;j<20;j++){ tab+='<img src="http://www.paris.fr/portail/charters/2/graphical/common/img/lumiplan/32.jpg" width="20" height="38">'; } $("#t1").html(tab); $("#t2").html(tab); $("#t3").html(tab); $("#t4").html(tab); $("#t5").html(tab); $("#t6").html(tab); $("#t7").html(tab); $("#t8").html(tab); $("#t1").css ( { opacity: (.6) } ); } ); function affiche(ligne) { tab=''; vide=' '; n=ligne.substr(5,1); //l = eval('window.document.forms[0].' + ligne + '.value'); l = $("#"+ligne).val() l=l.toUpperCase(); longueur=l.length; d=Math.floor((20-longueur)/2); g=20-longueur-d; l=vide.substr(0,g)+l+vide.substr(0,d); for (j=0;j<20;j++){ tab+='<img src="http://www.paris.fr/portail/charters/2/graphical/common/img/lumiplan/' + l.charCodeAt(j) + '.jpg" width="20" height="38">'; } $("#t"+n).html(tab); } function valid_mail(evt,ligne) { var keyCode = evt.which ? evt.which : evt.keyCode; var autorise = ' !"#$%&\'()*+,-./0123456789:;<=>?[\]_{|}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if (keyCode==13) { $("#"+ligne.name).next("input").focus(); return false; } if (keyCode==8 || keyCode==9) { timer=setTimeout("affiche('"+ligne.name+"');",1000); return true; } if (autorise.indexOf(String.fromCharCode(keyCode)) >= 0) { timer=setTimeout("affiche('"+ligne.name+"');",1000); return true; } else return false; } // ]]> // ]]> Les champs annotés d'un * sont obligatoires Votre message
|
||||||

Laisser un commentaire