Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to clear validation messages
Message
De
12/04/2013 13:31:59
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
Information générale
Forum:
Javascript
Catégorie:
JQuery
Divers
Thread ID:
01570813
Message ID:
01570817
Vues:
27
>Hi everybody,
>
>Right now I am observing the following behavior:
>
>1. I invoke my Edit form and make few validation errors to see validation messages
>
>2. I close the form without saving
>
>3. I open a new form and all validation messages are still here.
>
>I think my code is supposed to reset them - what do I miss?
>
>
>var validator = $("#add-edit-form").validate();
>
>var $dlg = $("#add-edit-dialog").dialog({
>   autoOpen: false,
>   show: "blind",
>   closeOnEscape: true,
>   resizable: true,
>   width: 1200,
>   height: 750,
>   minHeight: 600,
>   minWidth: 950,
>   buttons: {
>      Save: function () {
>
>         if ($("#add-edit-form").valid()) {
>
>            var urlLoc = '/Client/Edit/' + currentId;
>            if ($('#fntype').val() === "Add")
>               urlLoc = '/Client/Add';
>           
>            var form = $('form', this);
>            //debugger;
>            var oForm = form.serialize() + '&';
>            oForm = oForm.concat($('#frmClientsSearch').serialize());
>
>            $.ajax({
>               type: 'POST',
>               url: urlLoc,
>               data: oForm,
>               dataType: 'json',
>             
>               cache: false,
>               //contentType: 'application/json',
>               success: function (result) {
>                  
>                  $('#flexClients').flexAddData(result);
>               }
>            });
>            $(this).dialog('close');
>         } else return false;
>
>      },
>      Cancel: function () {
>         $(this).dialog("close");
>         clearForm();
>         if (validator)
>            validator.resetForm();
>      }
>   },
>   close: function () { clearForm(); },
>   open: function () {
>   }
>});
>
>Thanks a lot in advance.

SWAG...how about destroying the dialog?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform