Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > Possible bug with OnClick event

Answered Possible bug with OnClick event

Feed from this thread
  • kabbas avatar

    Posted on Nov 11, 2011 (permalink)

    Hello,

    I tried using the following code:

    @(Html.Telerik().NumericTextBox()
                    .Name(Model.Id.ToString())
                    .EmptyMessage("N/A")
                    .InputHtmlAttributes(new { onclick = "gridFocus(event)", style = "width:48px" })
                    .Value(Model.Value)
    )

    the problem is that gridFocus function will not be called unless I click on the numeric textbox more than once.

    If I click one time only, nothing happens.

    Please help with this issue,
    Thank you.

    Reply

  • Answer Dimo Dimo admin's avatar

    Posted on Nov 11, 2011 (permalink)

    Hi Kabbas,

    You are probably clicking on the formatted value, which is inside a separate <div> element.

    http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-numerictextbox-html-output-and-css-styles.html

    Use onfocus instead of onclick. This is more correct anyway, as the user can get inside the textbox with tabbing.

    Regards,
    Dimo
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now

    Reply

  • kabbas avatar

    Posted on Nov 11, 2011 (permalink)

    It worked.

    Thanks for the quick reply :)

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > Possible bug with OnClick event
Related resources for "Possible bug with OnClick event"

ASP.NET MVC NumericTextBox Features  |  Documentation  |  Demos  |  Telerik TV ]