Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Select contents on field select / tab

$
0
0
Hi Andrew,

For attaching the handler to the focus event you will have to place the JavaScript code within the editor template itself:
@model decimal?
  
@(Html.Kendo().NumericTextBoxFor(m => m)
      .HtmlAttributes(new { style = "width:100%" })
      .Spinners(false)
      .Decimals(2)
        
)
 
<script>
    $(function () {
        $("input[type=text]").bind("focus", function () {
            var input = $(this);
            clearTimeout(input.data("selectTimeId")); //stop started time out if any
 
            var selectTimeId = setTimeout(function () {
                input.select();
            });
 
            input.data("selectTimeId", selectTimeId);
        }).blur(function (e) {
            clearTimeout($(this).data("selectTimeId")); //stop started timeout
        });
    })
</script>


Hope this helps.


Regards,
Konstantin Dikov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>