简体   繁体   中英

Change bootstrap form based on the users active input. Display a change in the form only based on the text entered and no button clicks

Like credit card logo pops up as you enter in your credit card number. Instead of a logo I want to display a change in the form without a button click. Form automatically detects change after the input field has been filled.

Simple example:

In Angularjs

 $scope.changeStyle=function(){ $scope.color="red"; } 
  <form> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" ng-model="someName" ng-change="changeStyle()" id="exampleInputEmail1" ng-style="{'color':color}" placeholder="Email"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> 

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