dionel1969 Posted July 18, 2011 Posted July 18, 2011 Hello !!! I have a UniDateTimePicker on a form, and because it does not have the event OnKeyDown I trying to do via JS events. I did the following to simulate "click on the button called btnRefresh": function OnKeydown(sender, e) { if (e.keyCode == 13) { btnRefresh.click(); } } What I'm doing wrong??? Quote
Administrators Farshad Mohajeri Posted July 18, 2011 Administrators Posted July 18, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. Quote
dionel1969 Posted July 20, 2011 Author Posted July 20, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. Ok. Very good. Quote
dionel1969 Posted July 20, 2011 Author Posted July 20, 2011 BTW, could be posible to implement in this case the Event "OnKeyDown" ??? Quote
dionel1969 Posted July 20, 2011 Author Posted July 20, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. One question: Sender is DateTimePicker or Form??? Because if it is DateTimePicker I have not any event associated with it. The event is associated with button named btnRefresh. So the request must looks like: ajaxRequest(btnRefresh, 'btnRefreshClick'); Or I'm wrong???? Quote
Administrators Farshad Mohajeri Posted July 20, 2011 Administrators Posted July 20, 2011 You should handle this event in TUniDateTimePicker.OnAjaxEvent handler. I'm not sure if there is a way to call another button's click. Below code may work but I didn't test it: ajaxRequest(MainForm.btnRefresh, 'click'); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.