Display problems with verifying a form with "Remote"

Display problems with verifying a form with "Remote"

hello,

when i write in the email input text :
- an email saved in the data base, the red outline of the other text input disappear abnormally.
- an email properly structured email (no saved in the data base), the message "Adresse email déjà utilisée" appears for a few seconds, then it should not.

thank you in advance for your help and here is my code :


translation.tmx...
  1.     <tu tuid="errorLBoxEmail">
  2.       <tuv xml:lang="fr_fr"><seg>Email incorrect</seg></tuv>
  3.       <tuv xml:lang="en"><seg></seg></tuv>
  4.     </tu>
  5.     <tu tuid="errorLBoxEmail2">
  6.       <tuv xml:lang="fr_fr"><seg>Adresse email déjà utilisée</seg></tuv>
  7.       <tuv xml:lang="en"><seg></seg></tuv>
  8.     </tu>
  9. ...

new.phtml
  1. ...
  2. <div class="registrationLBoxColLine inputLBox">
  3.                     <label  id="emailLBoxLabel" class="required text lBoxLabel"><?php echo $translation->_('email') ?> (*)</label>
  4.                     <input type="text" name="email" class="required email lBoxInput" id="emailLBoxInput" />
  5.                     <!--  Error  -->
  6.                     <label class="error" id="emailLBoxError" for="emailLBoxInput">
  7.                         <span class="errorLeft"></span>
  8.                         <span class="errorCenter" id="errorCenterEmailSpan"><?php echo $translation->_('errorLBoxEmail') ?></span>
  9.                         <span class="errorCenter2" id="errorCenter2EmailSpan"><?php echo $translation->_('errorLBoxEmail2') ?></span>
  10.                         <span class="errorRight"></span>
  11.                     </label>
  12.                 </div>
  13. ...

ooptic.js

...

  1. $("#formValidator").validate( {
  2.         rules : {
  3.             email : {
  4.                 required: true,
  5.                    email: true,
  6.                 remote : "/User/index/check-email"
  7.             }
  8.         },
  9.         messages : {
  10.             email : {
  11.                 required : function() {
  12.                     $('#errorCenter2EmailSpan').hide();
  13.                     $('#errorCenterEmailSpan').show();
  14.                 },
  15.                 email : function() {
  16.                     $('#errorCenter2EmailSpan').hide();
  17.                     $('#errorCenterEmailSpan').show();
  18.                 },
  19.                 remote : function() {
  20.                     $('#errorCenterEmailSpan').hide();
  21.                     $('#errorCenter2EmailSpan').show();
  22.                 }
  23.             }
  24.         },
  25.         ignoreTitle : true,
  26.         errorPlacement : function( error, element) {
  27.             error.remove();
  28.         },
  29.         submitHandler : function(form) {
  30.             $(form).ajaxSubmit( {
  31.                 beforeSubmit : function() {
  32.                     $(document).scrollTop(0); // Top position of lightbox
  33.                 // (loader)
  34.                 $('#progressBarDisplay').show();
  35.                 $('#newUserContent').hide();
  36.             },
  37.             success : function(datas) {
  38.                 if (datas == 0) {
  39.                     $('#progressBarDisplay').hide();
  40.                     $('#newUserContent').show();
  41.                 } else {
  42.                     $("#datas").html(datas);
  43.                     /*
  44.                      * Ce n'est pas la bonne méthode à voir ensemble car ça
  45.                      * duplique le JS
  46.                      */
  47.                     // $('.global').load("/");
  48.             }
  49.             Ooptic.User.formValidator();
  50.         }
  51.             });
  52.         }
  53.     });
...