// version : 08/07/2006 //====================== // Validation //------------ function validation(){ var x=1; // Identification //---------------- if (c0c1==0){ if (document.frm.lgt.value == "" && x==1){ x=0; document.frm.lgt.focus(); alert (txjs[0]); return false; } if (document.frm.pwt.value == "" && x==1){ x=0; document.frm.pwt.focus(); alert (txjs[1]); return false; } } // mon - mononyme //------------------- if(document.frm.mon.value=="" && x==1){ x=0; document.frm.mon.focus(); alert (txjs[3]); return false; } if(document.frm.mon.value.length>20 && x==1){ x=0; document.frm.mon.focus(); alert (txjs[4]); return false; } // fau - codes des fautes //------------------------ document.frm.fau.value = ""; if(document.frm.f_a.checked == true) document.frm.fau.value = document.frm.fau.value + document.frm.f_a.value; if(document.frm.f_b.checked == true) document.frm.fau.value = document.frm.fau.value + document.frm.f_b.value; if(document.frm.f_c.checked == true) document.frm.fau.value = document.frm.fau.value + document.frm.f_c.value; if(document.frm.f_z.checked == true) document.frm.fau.value = document.frm.fau.value + document.frm.f_z.value; if(document.frm.fau.value=="" && x==1){ x=0; alert (txjs[5]); return false; } // txt - explication //------------------- if(document.frm.txt.value=="" && x==1){ x=0; document.frm.txt.focus(); alert (txjs[6]); return false; } if(document.frm.txt.value.length>2000 && x==1){ x=0; document.frm.txt.focus(); alert (txjs[7]); return false; } // em1 - email du plaignant //-------------------------- if(document.frm.em1.value=="" && x==1){ x=0; document.frm.em1.focus(); alert (txjs[8]); return false; } if(document.frm.em1.value.length>50 && x==1){ x=0; document.frm.em1.focus(); alert (txjs[9]); return false; } // em2 - email du fautif //----------------------- if(document.frm.em2.value.length>50 && x==1){ x=0; document.frm.em2.focus(); alert (txjs[10]); return false; } // Formulaire OK //--------------- if(x==1){ if(c0c1==0){ if(document.frm.lgts.checked==true && document.frm.lgt.value!="") SetCookie("c0",t2c(document.frm.lgt.value),exp); else SetCookie("c0","",exp); if(document.frm.pwts.checked==true && document.frm.pwt.value!="") SetCookie("c1",t2c(document.frm.pwt.value),exp); else SetCookie("c1","",exp); } document.frm.ok.value = txjs[2]; document.frm.ok.disabled = true; document.frm.submit(); } } // Fin de chargement //------------------- function onl(){ // Login //------- var lgt = GetCookie("c0"); if(lgt!=null && lgt!=""){ SetCookie("c0",lgt,exp); if (c0c1==0){ document.frm.lgt.value = c2t(lgt); document.frm.lgts.checked = true; } } // Mot de passe //-------------- var pwt = GetCookie("c1"); if(pwt!=null && pwt!=""){ SetCookie("c1",pwt,exp); if (c0c1==0){ document.frm.pwt.value = c2t(pwt); document.frm.pwts.checked = true; } } sca(); } // Scan du formulaire //-------------------- function sca(){ document.frm.txts.value = document.frm.txt.value.length+" / 2000"; setTimeout("sca()",500); }