Hello, I have programmed a form and don't wan't it to "html" submit, so i try to use Event.stop(event) . It doesn't seem to work after many tryouts. What do i do wrong?
The form : <form onsubmit="ModifierEmailCompte();" id="form_modifieremail" name=" form_modifieremail" method="post" action="fiche_joueur.fr.php"> <input type="text" value="[email protected]" class="saisietextecourt" id=" compteemail" name="compteemail" /> <button value="TRUE" name="btn_envoyer" class="boutonenvoyer" type="submit"> Modifier </button> <input type="hidden" value="[email protected]" id="emailorigine" name=" emailorigine" /> <input type="hidden" value="5238" name="id_user" /> <input type="hidden" value="modifieremail" name="action" /> </form> The javascript : function ModifierEmailCompte(event) { var emailRegEx = new RegExp( "^\\w[\\w+\.\...@[\\w\-]+\.\\w[\\w+\.\-]*\\w$", "gi" ) ; var email =$F('compteemail'); var email2 =$F('emailorigine'); if(email == "") { alert("Merci de saisir une adresse email avant de valider."); } else if(email.search(emailRegEx) == -1) { alert("L'adresse email saisie n'est pas valide."); } else if(email == email2) { alert("Veuillez modifier l'adresse email avant de valider."); } else { var url_ajax = 'fiche_joueur.emailmodifier.fr.php'; var target_ajax = 'modifieremail'; var params_ajax = Form.serialize("form_modifieremail"); new Ajax.Updater( target_ajax, url_ajax, { parameters: params_ajax, onSuccess: function() { Effect.Fade.delay(3, 'messagemodifieremail'); }, onFailure: function() { alert('Une erreur est survenue lors de la procédure ModifierEmailCompte.'); } } ); } Event.stop(event); } Thanks for any help. -- Joannes De KOSTER Société DEFI SUD -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
