Mam ten kod AngularJS próbujący pokazać dwie gwiazdki obok etykiety, gdy nie ma tekstu w obszarze tekstowym. Ten sam kod działa dla znaczników wejściowych, ale nie dla textarea.Sprawdzanie poprawności tekstowej JS kątowego
<div class="input-left">
<label for="email">
<span ng-show="contactform.email.$error.required" class="required">*</span>Email:
</label>
<input ng-model="email" type="text" name="email" id="email" required></br></br>
<label for="budget">Budzet:</label>
<input ng-model="budget" type="text" name="budget" id="budget">
</div>
<div class="clearboth">
<label for="msg" class="left" >
<span ng-show="contactform.msg.$error.required" class="required">**</span>Pitanja ili Komentari?
</label>
<textarea ng-model="msg" rows="8" cols="50" class="input-no-width rounded shaded left clearboth" id="msg" required></textarea>
</div>
Zgodnie z AngularJS documentation - textarea powinny zachowywać się tak samo jak dane wejściowe.
Dziękuję. Myślałem, że używa id. – Zec
To bardzo mi pomogło. Ale myślę, że dzieje się coś dziwnego w tym samym czasie. Mogę pominąć atrybut nazwy w polu wprowadzania tekstu i sprawdzanie poprawności będzie działało dobrze, ale textarea wymagają, żebym go tam miał. –