开发者

Why Virtual keyboard does not trigger AutocompleteList?

I have to use a Virtual(on screen) keyboard on a asp:textbox which has a AjaxControlToolkit's automcomplete attached to it, the virtual keyboard I use is the jQuery keypad plug in: http://keith-wood.name/keypadRef.html , but I have some problems with combining these two:

  1. Typing in the virtual keyboard does not trigger the Autocomplete list开发者_Python百科.
  2. When the textbox has autopostback=true if you click anything on virtual keyboard the textbox loses its focus and posts the form.

Does anyone knows that on respond to what events the autocomplete list activates? and also I need to know how to prevent textbox from losing its focus when a button on virtual keyboard is pressed?


1) JavaScript is setting the values and JavaScript does not trigger the autocomplete list from popping up. [and I doubt there is anyway to trigger it with JavaScript]

2) Clicking on the "keyboard" removes focus from the textbox and presto, the blur event fires and submits the form. [You would have to code your own autopostback=true] Basic idea is to add a timeout that calls document.forms[0].submit() and if the focus is added back to the textbox before the timeout fires clearTimeout()

var textbox = document.getElementById("yourElementId");
textbox.blur = function(){ this.timer = window.setTimeout( function(){ document.forms[0].submit(); }, 100 ) };
textbox.focus = function(){ if(this.timer) window.clearTimeout( this.timer ); };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜