2017-07-13 35 views
0

就像您輸入信用卡號時彈出信用卡標誌一樣。我不想點擊按鈕,而想要在表單中顯示更改。輸入字段填充後,表格會自動檢測更改。根據用戶活動輸入更改引導表單。只根據輸入的文本在表單中顯示更改,並且不點擊任何按鈕

+0

泰倫斯您好,歡迎SO!不要猶豫,看看[如何問](https://stackoverflow.com/help/how-to-ask)文檔。它可以幫助你創建更好的問題,幫助其他人解決同樣的問題。你也可能會更快,更準確地回答。 –

回答

0

簡單的例子:

在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>

相關問題