如何通过弹出键盘在表单字段中填写数字(使用 Javascript/AJAX)
我有一个小项目,其中我需要开发一个带有所有数字+退格+小数(全部作为按钮)的键盘。单击时这些数字应填充表单字段(例如文本框)。该键盘应作为链接位于表单字段旁边。
键盘最好是 Javascript/AJAX。此外,键盘例程应该有一个关闭按钮,以便最小化弹出键盘。 (它与我们在票务网站中看到的日历控件非常相似。)
对键盘例程进行四舍五入没有什么特别的,只是在单击数字(按钮)时填充表单字段。
我需要帮助编写键盘例程。我该如何设计 JavaScript?如何包含按钮(文件中的数字+小数+退格键)?如何编写单击按钮时该值显示在表单字段中的部分?
非常感谢任何帮助。
谢谢
I have a small project, wherein I need to develop a keypad with all the digits+backspace+decimal (all as buttons). These digits when clicked should populate a form field (say a text box). This keypad should be located next to the form field as a link.
The keypad should be preferably Javascript/AJAX. Also the keypad routine should have a close button in order to minimize the popup keypad. (It's very much similar to a calendar control which we see in ticketing websites.)
To round up the keypad routine does nothing fancy but to just populate the form field, when the digits (buttons) are clicked.
I need help with coding the keyboard routine. How do I design the javascript? How to include the buttons (for the digits+decimal+backspace in the file)? How to code the part where when the buttons are clicked, then that value is showed in the form field?
Any help is greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在哪里?
不需要使用ajax。非常快速而肮脏的例子:
不要“按原样”使用...使用 css 样式表、函数等。
Where's the problem?
No need to use ajax. Very quick and dirty example:
Do not use "as is"... use css stylesheets, functions, etc.