Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: how to make a text Field to take only numbers in sapui5,please share the code

$
0
0

Hi ajaay krishna

var textbox = new sap.ui.commons.TextField("data",{});  textbox.attachBrowserEvent("keypress",function(e){  var key_codes = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 8];            if (!($.inArray(e.which, key_codes) >= 0)) {              e.preventDefault();            }             });

This worked perfectly for me.

 

Sreehari


Viewing all articles
Browse latest Browse all 9164

Trending Articles



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