在聚合物中,我试图手动提交表格.我的表单看起来像这样:
<form id="myForm" on-submit="{{ submitForm }}">
<input class="text" value="{{ someValue}}">
<button type="submit">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
在聚合物对象中,我有:
submitForm: function(e) {
e.preventDefault();
}
Run Code Online (Sandbox Code Playgroud)
每当我尝试执行以下操作时:
document.getElementById('myForm').submit();
Run Code Online (Sandbox Code Playgroud)
表单完全忽略on-submit属性并将表单发布到新页面.
我正在为任何想知道我为什么要这样做的人建立一个屏幕键盘.每当有人点击屏幕键盘上的回车键时,我都需要提交表格.
有谁知道为什么会这样?
一个JSBin示例,向您展示确切的问题(请参阅警报):http://jsbin.com/wadihija/2/
自从06-09-2014在Firefox 32.0中更新到Firebug 2.0.4以来,我一直遇到使用Polymer的问题.每当我使用Polymer(也使用网站polymer-project.org)重新加载页面,Firebug在该网站上打开时,Firefox会挂起来告诉问题来自:
脚本:chrome://firebug/content/debugger/script/sourceTool.js:791
我降级到Firebug的早期版本,浏览器在重新加载时停止了.
这适用于现在但有没有人知道解决这个或任何事情的不同方式?