在 jQueryMobile / Mobile Safari 中按“提交”后不要隐藏键盘
我正在为 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在回调中/提交完成后将焦点添加回“#chat”字段。
这是我创建的一个演示,用于模拟功能(在 iPhone 上测试)...
演示:http:// jsfiddle.net/wdm954/hYn7k/1/
Try adding focus back to the '#chat' field on a callback / after your submit has completed.
Here is a demo I created that simulates the functionality (tested on iPhone)...
Demo: http://jsfiddle.net/wdm954/hYn7k/1/