本文介绍了Java脚本和虚拟键盘的jsp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在jsp页面上为虚拟键盘运行javascript ????
How to run javascript on jsp page for virtual keyboard?????
推荐答案
- HTML中的每个文本框都必须具有onfocus事件的事件处理程序.
- 您必须包括div或其他合适的容器,该容器具有构成虚拟键盘的控件(按钮等).
- 通常会隐藏以前的键盘容器
- 在收到onfocus事件后,您将记住当前处于活动状态的文本框并开始使用键盘显示容器
- 键盘按钮还具有事件处理程序,这些事件处理程序会在按下某个虚拟键时进行注册
- 在文本框中执行相应的操作,该操作由我们的代码在步骤4中存储.
- 额外的好处:还存储内容在进行编辑之前,您可以在虚拟键盘上使用一个撤消按钮,以防您弄乱了编辑.
- Every textbox in you html must have an event handler for the onfocus event.
- You must include a div or some other suitable container which has the controls (buttons etc) that make up your virtual keyboard.
- Former keyboard container is usually hidden
- Upon receiving the onfocus event you memorize which textbox is currently active and start showing the container with the keyboard
- The keyboard buttons also have event handlers which register when a certain virtual key was pressed
- Execute the appropriate actions on the textbox which was memorized by our code in step 4
- Extra bonus: also memorize the content prior to editing so you can have an undo button on your virtual keyboard in case you messed up your editing.
首先,如果遇到问题,请回来并提出更具体的要求!
最好的问候,
-MRB
Start with this and if you run into problems come back and ask more specifically!
Best Regards,
-MRB
这篇关于Java脚本和虚拟键盘的jsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!