YUI DIalog:如何在按下回车键时停止表单成为海报?
我们使用 YUI 2.9.0,在表单上我们遇到一个问题:如果我们在输入类型=“text”上按 Enter 键,表单将以“正常方式”提交,而不是通过 YUI Dialog 的异步模式( “正常方式”是纯HTML Web中使用的方式,没有JS和Web 2.0异步通信)。
在此页面上,我可以看到该错误已在版本 2.3.1 中得到处理,但我仍然有一个问题 http://tech.groups.yahoo.com/group/ydn-javascript /消息/30139 事实上,取决于表单的内容:使用文本和选择字段我遇到问题,如果我有日期选择器,它就可以正常运行。
有什么方法可以停止输入按键?
We use YUI 2.9.0, and on a form we have a problem : if we press enter on an input type="text", the form is submitted the "normal way", and not via the async mode of YUI Dialog (the "normal way" is the one used in pure HTML web, without JS and web 2.0 asynchronous comm).
On this page I can see the bug was handled in version 2.3.1, but I still have one issue
http://tech.groups.yahoo.com/group/ydn-javascript/message/30139
In fact in depend of the content of the form : with a text and a select field I have the issue, if I had the datepicker it's run ok.
Is there any way, appart of key listerner wich stop enter key press?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过将其放入表单标签来关闭对话框上的表单提交:
然后您必须将事件侦听器放置到您的按钮或自己执行 XHR 提交。
尽管如果您在对话框中使用此声明,并且在handleSubmit 中将 isDefault 设置为 true,那么您可能不会在 Enter keypress 上提交表单。
you can shutdown form submissions on your dialog by putting this in the form tag:
you'll then have to put an event listener to your button or do the XHR submission yourself .
althought if you use this declaration for your dialog with isDefault set to true in handleSubmit you wouldnt probably have the form submitted on enter keypress .