0

I have a NumberTextBox in a grid cell. How do I keep focus if input is out of range or invalid? (such that user cannot click away from the cell)?

Thanks!

Michael
  • 161
  • 2
  • 13

1 Answers1

0

You can try something like this

function lockUserOnInput() {

  if( ! dijit.byId('NumberBox').validate()) {
     dijit.byId('NumberBox').focus();
     dijit.byId('NumberBox').inputNode.focus(); // make damn sure
  }

}

setInterval(lockUserOnInput, 250); // set the interval as intense as you need it to be :)
mschr
  • 8,531
  • 3
  • 21
  • 35