Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using placeholder makes control dirty?
Message
 
 
À
Tous
Information générale
Forum:
Internet
Catégorie:
Autre
Titre:
Using placeholder makes control dirty?
Divers
Thread ID:
01628439
Message ID:
01628439
Vues:
30
I found an interesting problem. Here is the element
<div class="col-md-6 col-lg-6">
                        <input type="text" name="opCode" id="opCode" ng-model="currentOperator.opCode" placeholder="Operator code" class="form-control ng-untouched ng-valid ng-valid-maxlength ng-hide ng-valid-required ng-dirty" ng-maxlength="6" ng-show="isNew" ng-required="isNew">
                        <div class="field-validation-error ng-hide" ng-show="form.editOperatorGeneralForm.opCode.$error.required && form.editOperatorGeneralForm.opCode.$dirty">
                            <span>Operator code is required.</span>
                        </div>
                        <div class="field-validation-error ng-hide" ng-show="form.editOperatorGeneralForm.opCode.$error.maxlength  && form.editOperatorGeneralForm.opCode.$dirty">
                            <span>Operator code cannot exceed 6 characters.</span>
                        </div>
                    </div>
Please note the ng-dirty class applied although there is also ng-untouched class.

If I remove the placeholder, this element and another element also with the placeholder no longer have ng-dirty class applied.

That's weird.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform