웃웃웃웃웃
웃웃웃웃웃

Reputation: 11984

Setting focus to kendo numeric textbox

I am using the following code to create a kendo numeric textbox.

Html

<input type='text' name='num_wks_or_mons' id='num_wks_or_mons' tabindex='5'/>

Jquery

$("#num_wks_or_mons").width(295).kendoNumericTextBox({
            min:0,
            max:99,
            step:1,
            format: "n0"
        });

Evenif i am setting the tabindex attribute as 5 the element will not get the focus if if tabout from elemnent with tabindex = 4.When i tabout from element with tabindex = 4 the focus is going to the next element which is not a kendo numeric textbox.

Upvotes: 3

Views: 4884

Answers (5)

Denis Kozlov
Denis Kozlov

Reputation: 11

Try to this:

var $nodeNumeric = $nodeImput.kendoNumericTextBox().data("kendoNumericTextBox");
$($nodeNumeric._text).focus();

Upvotes: 1

phillhutt
phillhutt

Reputation: 323

The Kendo UI Numeric Text Box widget has it's own focus method. Get the instance of the widget and call that.

var numerictextbox = $("#num_wks_or_mons").data("kendoNumericTextBox");
numerictextbox.focus();

https://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox/methods/focus

Upvotes: 1

prasadd
prasadd

Reputation: 324

Set focus like this,

 $('#num_wks_or_mons').siblings('input:visible').focus();

Upvotes: 7

Girija Mohanty
Girija Mohanty

Reputation: 26

<script type="text/javascript">
    $(document).ready(function () {
      setTimeout(function() {
          $('#txtThresholdAmount').siblings('input:visible').focus();
      }, 1000);
  });
</script>

Upvotes: 0

Jaimin
Jaimin

Reputation: 8020

Set focus like this,

   setTimeout("$('#num_wks_or_mons').focus();", 500);

Upvotes: 0

Related Questions