谷歌浏览器未提交表单(js错误?)

发布于 2024-11-09 11:35:52 字数 326 浏览 0 评论 0 原文

我无法让 Google Chrome 提交我的表单。这变得非常荒谬。它最终会聚焦于一个随机表单字段(但每次都是相同的)。

FF 或 IE 没有问题...

Chrome 在开发人员工具中给我的两个错误是:

An invalid form control with name='state' is not focusable.
An invalid form control with name='unitName' is not focusable.

但是,这些甚至不是 Chrome 决定关注的领域。我很茫然,有没有人有这样的经历??

I can't get Google Chrome to submit my form. It's getting pretty ridiculous. It ends up focusing a random form field (but it's the same one every time) instead.

No issues with FF or IE...

Two of the errors Chrome gives me in developer tools are:

An invalid form control with name='state' is not focusable.
An invalid form control with name='unitName' is not focusable.

BUT, these aren't even the one field that chrome is deciding to focus on. I'm at a loss, any one had any experience like this??

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

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

发布评论

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

评论(3

好菇凉咱不稀罕他 2024-11-16 11:35:52

我遇到了这个问题,输入字段标记为“必填”,但通过 javascript 使其不可见。 Chrome 无法显示“请填写此字段”,因此它显示“名称='描述'的无效表单控件在控制台中无法聚焦”。

I had this exact problem with an input field marked "required" that was made invisible via javascript. Chrome could not display "please fill out this field" so it said An invalid form control with name='description' is not focusable in the console.

愿与i 2024-11-16 11:35:52

在没有看到 HTML 的情况下,谷歌搜索发现了以下内容:

问题的根源似乎是将 maxlength 属性分配给由浏览器自动填充的表单字段,其值超过了 maxlength 限制。

Without seeing the HTML, here's what a little Google'ing turned up:

The root of the problem appears to be assigning a maxlength attribute to a form field that is automatically populated by the browser, with a value that is longer than the maxlength limit.

拥抱没勇气 2024-11-16 11:35:52

我刚刚遇到了类似的问题,对我来说,解决方法是将 type="button" 添加到我的

I just had a similar problem, and for me, the fix was adding type="button" into my <button> tag.

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