Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

CodeHow to call ng-blur before ng-click for Mobile browsers

$
0
0

In my application, we have text box and button in same page. we will fetch details through ng-blur of that text box, and then we will validate those values which is retrieved from ng-blur in Button ng-click function.

But ng-click is triggering before ng-blur when customer directly click that button after entered values in text box.

Its working fine in desktop browsers that ng-blur calling before ng-click. But not working for mobile browsers. I googled solution for this, but i did not get the solution. Sorry for my english, please let us know if anybody have the solution.

Html Code :

<input type="text" ng-model="txndata.txnNo" id="txnNo" 
                        ngomitsplchar class="form-control"
                        on-blur="getTxnData(txndata)" 
                        tabindex="5" spellcheck="false" autocomplete="nope">


 <button type="button" class="btn btn-primary btn-md" tabindex="17" id = "validate" class="btn but_small1" ng-click="validate(txndata);">Enquiry</button>

JS Code :

 $scope.getTxnData = function (formObj) {
    // Ajax call and other process
 }

$scope.validate = function (formObj) {
    // Validation and submit process
 }

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>