简体   繁体   English

需要按两次按钮,首先关闭键盘,然后发送。 如何停止呢?

[英]Need to press button twice, first to close keyboard second to send. How do I stop this?

I have a case where I have users that can enter text in a field for a mobile web site. 在某些情况下,我的用户可以在移动网站的字段中输入文本。

They then need to press a button to send the message but they have to press it twice, once to close the keyboard and the second to send the message. 然后,他们需要按下一个按钮来发送消息,但是必须按下两次,一次是关闭键盘,第二次是发送消息。

The sending is taking place via JQuery Ajax fired from an event handler. 发送是通过事件处理程序触发的JQuery Ajax进行的。 I have preventDefault on if that matters. 如果这很重要,我可以使用preventDefault。

Is there a way around this? 有没有解决的办法?

从单击按钮上的输入中移出焦点,以隐藏软件键盘:

$("input").blur();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用CasperJS发送逃逸按键(关闭模式)? - how do I send an escape key press (to close a modal) with CasperJS? 如何获得不透明性以停止按下按钮的褪色? - How do I get the opacity to stop fading with a button press? 如何阻止客户两次单击 Ajax 表单按钮? - How Do I Stop Customers Clicking Ajax Form Button Twice? 无需关闭窗口,如果我按确认框中的取消按钮? - No need to close the window, If I press the cancel button in confirmation box? 为什么我需要按两次才能显示元素 0? - Why do i need press twice to display the element 0? textarea not send form 不发送form 先点击发送。 在 2 单击是 - textarea not send form do not send form the first click to send. The at 2 click yes 其次通过按钮执行功能 - Second do function by press button javascript:需要按两次按钮才能onclick触发 - javascript: need press button twice for onclick to trigger 引导程序隐藏弹出窗口需要按两次按钮 - Bootstrap to hide popover need press button twice 如何在按下按钮时关闭弹出窗口,并在打开弹出窗口的窗口上发起回发? - How do I close a popup window on a press of a button and initiate postback on the window opening the popup?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM