在 jQueryMobile / Mobile Safari 中按“提交”后不要隐藏键盘

发布于 2024-11-29 16:37:41 字数 546 浏览 3 评论 0原文

我正在为 iOS/Android 浏览器开发基于移动网络的表单。一切功能正常。

我似乎无法做的是在用户按下表单上的“提交”按钮后将键盘保持在顶部。目前,只要我点击“提交”,键盘就会默认隐藏。在在这里发布此请求之前,我已经尝试了我能想到的一切。

我的代码:

<form action="" onsubmit="return false;">
             <input id='chat' type="text" name="message" value="" data-inline="true" placeholder="Start typing your message here" />
             <button id='doSend' type="submit" data-inline="true">Submit</button>
</form>

正在使用 jQueryMobile 1.0 beta2 + iPhone 4 进行测试。

任何想法都值得赞赏。谢谢。

I am working on a mobile web based form for iOS/Android browsers. Everything works fine functionally.

What I can't seem to do is keep the keyboard on top AFTER the User presses the 'Submit' button on the form. Currently, as soon as I tap 'Submit' the keyboard hides by default. I have tried whatever I could think of before posting this request here.

My code:

<form action="" onsubmit="return false;">
             <input id='chat' type="text" name="message" value="" data-inline="true" placeholder="Start typing your message here" />
             <button id='doSend' type="submit" data-inline="true">Submit</button>
</form>

Am testing this with jQueryMobile 1.0 beta2 + iPhone 4.

Any ideas are appreciated. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

临风闻羌笛 2024-12-06 16:37:41

尝试在回调中/提交完成后将焦点添加回“#chat”字段。

$('#chat').focus();

这是我创建的一个演示,用于模拟功能(在 iPhone 上测试)...

演示:http:// jsfiddle.net/wdm954/hYn7k/1/

Try adding focus back to the '#chat' field on a callback / after your submit has completed.

$('#chat').focus();

Here is a demo I created that simulates the functionality (tested on iPhone)...

Demo: http://jsfiddle.net/wdm954/hYn7k/1/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文