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

[Solved] Possible bug with OnClick event

2 Answers 36 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
kabbas
Top achievements
Rank 1
kabbas asked on 11 Nov 2011, 01:24 PM
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.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 11 Nov 2011, 02:37 PM
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
0
kabbas
Top achievements
Rank 1
answered on 11 Nov 2011, 04:02 PM
It worked.

Thanks for the quick reply :)
Tags
NumericTextBox
Asked by
kabbas
Top achievements
Rank 1
Answers by
Dimo
Telerik team
kabbas
Top achievements
Rank 1
Share this question
or