We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Focus on numerictextbox

Hi,

how to programatically set focus to numerictextbox?

Simple $("#SomeControl").focus(); doesen't work.



1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team September 28, 2017 12:44 PM UTC

Hi Semper,   
   
In our Numeric, Currency, Percentage Textboxes having two inputs (hidden and input element). Both the inputs are switching while interacting with the numeric textbox. Initially hidden Input is displayed to the user, while interact numeric textbox, element will be displayed. So, you can apply the jQuery focus on hidden input to focusing the Numeric Textbox. Please check the below code block.   
 
[Scripts]   
   
var numeric = $("#ejNumeric").ejNumericTextbox("instance");   
numeric._hiddenInput.focus();   
   
  
For your reference, we have prepared simple sample. Please check the sample in below playground location.   
   
 
Please let us know, if the provided information’s are helpful to achieve your requirement or not.  
 
Regards,    
Ashokkumar B.    


Loader.
Live Chat Icon For mobile
Up arrow icon