简体   繁体   中英

Angularjs textarea input empty space not allowed

I have a form which has textarea control for description but can't insert empty space. Alphanumeric and numeric characters can be inserted but space character not allowed.

<textarea class="form-control" rows="4" maxlength="{{vm.model.maxLength}}" 
id="comment" ng-model="vm.model.FreeText" ng-required="true" ng-maxlength="
{{vm.model.maxLength}}" ng-disabled="vm.model.FreeTextIsdisabled" ng-
trim="false"></textarea>

Remove ng-trim="false" in your text area because of If set to false AngularJS will not automatically trim the input.

check this as well : Change AngularJS ngTrim Behavior

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM