Skip to Content
avatar image
Former Member

Validating sap.m.input gets focus out of that field

Hi all,

I am trying to validate an input field. I need to accept only positive integer values.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {color: #931a68}
span.s2 {color: #3933ff}
  onInputChange: function(evt) {

        var val = evt.getSource().getValue();

        if (isNaN(val)){

        val = val.match(/^-?\d+\.?\d*$/);

        }

        evt.getSource().setValue(val);

    }

Actually this works fine for me except when user enters a single character, input field loses the focus. Does anybody have a solution about this.

Thanks in advance,

Kerem

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers