This is a migrated thread and some comments may be shown as answers.

How can I set focus to the numeric text box?

9 Answers 1571 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Okosv
Top achievements
Rank 1
Okosv asked on 11 Jul 2012, 06:37 AM
Hi All,

How can I set focus to the kendo numerictextbox?

via $("#controlid").focus(), $("#controlid").select()  it doesn't work.

9 Answers, 1 is accepted

Sort by
0
Okosv
Top achievements
Rank 1
answered on 12 Jul 2012, 02:11 PM
up
0
PAUL
Top achievements
Rank 1
answered on 20 Aug 2012, 02:29 PM
Really? posted all the way back in July and still no answer? Can't figure this one out either. Thanks for the help Kendo team...
0
Georgi Krustev
Telerik team
answered on 21 Aug 2012, 08:42 AM

UPDATE (10/2012): The NumericTextBox widget now have "focus" method which should be used instead of the following solution. 

Hello Paul,

As you probably know, the NumericTextBox has two input elements. The one which you try to focus is hidden. In order to achieve your goal you just need to focus the visible input. Check this jsBin demo.

As a side note, although we monitor forum threads, we do not guarantee a timely reply there. If you need a guaranteed answer in 24 hour response time, then I will suggest you open a support ticket.

 
Kind regards,
Georgi Krustev
the Telerik team
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
PAUL
Top achievements
Rank 1
answered on 21 Aug 2012, 10:55 AM
Ok thanks a lot that worked great. I could not find out how to do this simple task anywhere in the documentation...I apoligize I am new to Kendo.

0
Georgi Krustev
Telerik team
answered on 21 Aug 2012, 12:00 PM
Hello Paul,

 
In the latest internal build, we add a focus() method, which will focus the widget. It will be documented for the comming service pack (scheduled for the mid of September).

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Saso
Top achievements
Rank 2
answered on 25 Mar 2014, 10:47 AM
is it possible to set focus to specific widget in MVVM

template for one widget
<div class="mvvmElement mvvmBorder" data-bind="visible: obj_priceUM.visible" style="left:40px; top:88px; width:112px; height:36px; z-index:0">
<label class="mvvmLabel right" style="width:100%;">
Cena za EM
<br />
<input data-role="numerictextbox" data-format="n2" data-decimals="2" data-spinners="false" data-bind="value: obj_priceUM.value, enabled: obj_priceUM.enabled" style="width:112px;" />
</label>
</div>

videmodel 
    obj_priceUM: {
        visible: true, value: "0", enabled: true
    }

0
Georgi Krustev
Telerik team
answered on 25 Mar 2014, 12:56 PM
Hello Saso,

Currently, Kendo MVVM does not provide a focus binder. Nevertheless, you can define a custom one, which will focus the widget.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Robert
Top achievements
Rank 2
answered on 12 Sep 2016, 06:19 PM

On the afterShow binding for the view, I call this code: $("#input_id").siblings("input:visible").focus();

Also put the autofocus tag on the HTML input.  

For the maskedTextBox, I use autofocus and $("input_id").focus() for the afterShow view event.

0
Anton Mironov
Telerik team
answered on 16 Sep 2020, 01:18 PM
Hi,

I would like to share with you that as of Kendo UI version 2020.2.617, our team has added the "selectOnFocus" property covering the pointed requirements in this thread.  For your future web development, feel free to utilize this implementation shown here:
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
    selectOnFocus: true
});
</script>
If you have any questions about the new functionality don't hesitate to contact our team.

 

Kind Regards,
Anton Mironov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
NumericTextBox
Asked by
Okosv
Top achievements
Rank 1
Answers by
Okosv
Top achievements
Rank 1
PAUL
Top achievements
Rank 1
Georgi Krustev
Telerik team
Saso
Top achievements
Rank 2
Robert
Top achievements
Rank 2
Anton Mironov
Telerik team
Share this question
or