Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validations of the input
Message
De
31/08/2017 03:55:49
 
 
Information générale
Forum:
AngularJS
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01653867
Message ID:
01653872
Vues:
42
>Hi everybody,
>
>I am wondering if anyone did server-side validations of input fields directly (e.g. not on submit). If yes, can you provide examples / point me to the good papers on the topic?
>
>In particular, I'd like to validate barcode (or UPC) for uniqueness as the user enters it.
>
>I wrote the following in my service
>
>
>ItemService.prototype.checkCodeUniqueness = function (code) {
>        var deferred = services.Deferred;
>
>        services.Http.get(urlPath + '/checkCodeUniqueness/' + encodeURIComponent(code))
>            .then(function (data) {
>                deferred.resolve(data.data);
>            });
>
>        return deferred.promise;
>    };
>
>but I don't know if this is correct (e.g. how would I decode in C# and how would I implement the validations on the input).
>
>I would appreciate suggestions / code examples.
>
>Thanks in advance.

Not sure what you actually want to check, 'uniqueness' implies checking that it's not already stored, 'validity' suggests you just want to check the length and checksum? The latter could easily be done with client side javascript.
Also no clear where/when you are calling checkCodeUniqueness() ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform