admin管理员组文章数量:1287591
I want to get the value of the textbox on keypress.
I have html code like
<input style="width: 20%; float: right;"
ng-model="que.SelectedOptionsUID"
type="text"
ng-keypress="myFunct($event)"/>
And JS code on my controller:
$scope.myFunct = function (e) {
var charCode = (e.which) ? e.which : e.keyCode;
//i want here value of the textbox
}
I want to get the value of the textbox on keypress.
I have html code like
<input style="width: 20%; float: right;"
ng-model="que.SelectedOptionsUID"
type="text"
ng-keypress="myFunct($event)"/>
And JS code on my controller:
$scope.myFunct = function (e) {
var charCode = (e.which) ? e.which : e.keyCode;
//i want here value of the textbox
}
Share
Improve this question
edited Jan 6, 2015 at 13:44
augustoccesar
6669 silver badges30 bronze badges
asked Jan 6, 2015 at 13:31
sagar43sagar43
3,4643 gold badges31 silver badges49 bronze badges
0
1 Answer
Reset to default 7<input style="width: 20%; float: right;"
ng-model="que.SelectedOptionsUID"
type="text"
ng-keypress="myFunct($event, que.SelectedOptionsUID)"/>
Controller:
$scope.myFunct = function (e, myValue) {
var charCode = (e.which) ? e.which : e.keyCode;
// do something with myValue
}
本文标签: javascriptGet value of textbox on ngkeypress in AngularjsStack Overflow
版权声明:本文标题:javascript - Get value of textbox on ng-keypress in Angularjs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741312122a2371704.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论