function init_(){ var CacheTexte_CONTACT = new Object(); var texte_CONTACT = new Object(); if ($('bt_CONTACT')) $('bt_CONTACT').replace('' + $('bt_CONTACT').innerHTML + ''); CacheTexte_CONTACT['label_CONTACT_name']=$('label_CONTACT_name').innerHTML; CacheTexte_CONTACT['label_CONTACT_email']=$('label_CONTACT_email').innerHTML; CacheTexte_CONTACT['label_CONTACT_email']=$('label_CONTACT_email').innerHTML; CacheTexte_CONTACT['label_CONTACT_captcha']=$('label_CONTACT_captcha').innerHTML; CacheTexte_CONTACT['label_CONTACT_body']=$('label_CONTACT_body').innerHTML; CacheTexte_CONTACT['label_CONTACT_subject']=$('label_CONTACT_subject').innerHTML; //submit Event.observe($('bt_CONTACT'),'click',function(){ var isValid = true; var tx = []; if ($F('CONTACT_name')=='' || $F('CONTACT_name')==''){ isValid = false; tx['label_CONTACT_name'] = true; texte_CONTACT['label_CONTACT_name'] = ' Ce champ est obligatoire'; } var expr=new RegExp("[A-Za-z0-9]([-_.]?[A-Za-z0-9])*@[A-Za-z0-9]([-_.]?[A-Za-z0-9])*\.([a-z]{2,4})$"); if (!expr.test($F('CONTACT_email'))){ isValid = false; tx['label_CONTACT_email'] = true; texte_CONTACT['label_CONTACT_email'] = 'Cet e-mail ne semble pas valide'; } if ($F('CONTACT_email')=='' || $F('CONTACT_email')==''){ isValid = false; tx['label_CONTACT_email'] = true; texte_CONTACT['label_CONTACT_email'] = ' Ce champ est obligatoire'; } if ($F('CONTACT_captcha')=='' || $F('CONTACT_captcha')==''){ isValid = false; tx['label_CONTACT_captcha'] = true; texte_CONTACT['label_CONTACT_captcha'] = ' Ce champ est obligatoire'; } if ($F('CONTACT_body')=='' || $F('CONTACT_body')==''){ isValid = false; tx['label_CONTACT_body'] = true; texte_CONTACT['label_CONTACT_body'] = ' Ce champ est obligatoire'; } if ($F('CONTACT_subject')=='' || $F('CONTACT_subject')=='Array'){ isValid = false; tx['label_CONTACT_subject'] = true; texte_CONTACT['label_CONTACT_subject'] = ' Ce champ est obligatoire'; } for (key in texte_CONTACT){ if($(key)){ $(key).update(CacheTexte_CONTACT[key] + texte_CONTACT[key]); } if (typeof (tx[key]) != 'undefined') texte_CONTACT[key]=''; } if (isValid) { $('CONTACT').submit(); }else{ } });//fin }