问题标签 [html5-validation]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
html - 如何一次显示 HTML5 验证的所有错误?
当我们使用 HTML5 Validation 验证表单时,它只显示一个错误,尽管表单上可能有更多错误。因此,用户将只修复一个错误并再次提交表单以知道还有另一个错误。这可能会让用户感到沮丧,并且会带来非常糟糕的用户体验。我们怎样才能一次看到所有的验证错误?
TJ VanToll编写了一些 JavaScript ,它获取表单的所有验证错误并显示在表单顶部。但我想以默认的 HTML5 方式在表单旁边显示所有错误。
html - addthis 和谷歌分析没有通过 html5 验证
这些是我得到的错误和警告:
第 135 行,第 134 列:& 没有开始字符引用。(& 可能应该被转义为 &。)Rk44QGJO&hl=he">
第 135 行,第 309 列:iframe 元素上的 frameborder 属性已过时。改用 CSS。…ight="300" width="500" frameborder="0">
第 161 行,第 116 列:属性 addthis:url 不可序列化为 XML 1.0。
属性 addthis:title 不可序列化为 XML 1.0。
属性 addthis:description 不可序列化为 XML 1.0。
此时元素 div 上不允许使用 addthis:url 属性。
此时元素 div 上不允许使用 addthis:title 属性。
属性 fb:like:layout 不可序列化为 XML 1.0。
此时元素 a 上不允许使用 fb:like:layout 属性。
这是addthis代码:
有谁知道如何修复那里的错误?
谢谢
html - 输入类型不是“提交”时的 HTML5 验证
我正在使用 HTML5 来验证字段。我在单击按钮时使用 JavaScript 提交表单。但是 HTML5 验证不起作用。它仅在输入类型为 时才有效submit
。除了使用 JavaScript 验证或将类型更改为 之外,我们还能做任何事情submit
吗?
这是 HTML 代码:
我在函数中提交表单submitform()
。
html - html5 required checkbox isn't working with civem.js if user clicked submit before checking
I am using civem.js to customise my html5 form elements error messages and its all working fine.
However if user accidentally clicked on submit before ticking the required checkbox, the will be promoted with the assign error message which is fine. Now if user went back and checked it, the form will not submit asking them to check the box. it's like it wont kick the checkbox out of required mode onclick.
Here is a link http://jsfiddle.net/BqUNS/, please click submit before ticking the checkbox.
Any help would be appreciate it.
javascript - 如何检测尝试提交的无效 HTML 表单?
使用HTML5 表单验证时,表单中的输入值无效将停止提交该表单。如何检测用户尝试提交失败的表单?当提交因验证失败而停止时,表单的onsubmit
处理程序不会触发。
我目前正在监听提交按钮上keypress
的click
事件以检测提交尝试。有没有更好的方法来检测表单提交失败?
html - HTML5 表单模式/验证
我正在尝试为 HTML5 表单提出一个有效的模式。我想允许所有大小写字母、空格、数字和符号 / \ @ # $ % & 。
我尝试了几种不同的格式,但我没有任何运气。
到目前为止,我有:
javascript - How to manually show a HTML5 validation message from a JavaScript function?
I want to know if there is any way to programatically show a HTML5 validation error, using a JavaScript function.
This is useful for scenarios where email duplication has to be checked. For example, a person enters an email, presses the Submit button, and then has to be notified that this email is already registered or something.
I know there are other ways of showing such an error, but I wanted to display it in the same way as how the validation error messages are shown (e.g. invalid email, empty field, etc.).
JSFiddle: http://jsfiddle.net/ahmadka/tjXG3/
HTML Form:
JavaScript:
The above code sets the custom message, but its not automatically shown. It's only shown when the person presses the submit button or something.
joomla2.5 - 试图在 Joomla 2.5 网站上验证 HTML5,但我有一些元问题
我目前正在尝试清理 Joomla 2.5 站点以进行 HTML5 验证,但我遇到了问题。
HTML5 验证器报告以下错误:
“错误值 og:title 元素元上的属性名称:关键字 og:title 未注册。”
“错误值 og:元素元上属性名称的类型:关键字 og:类型未注册”
“元素元上属性名称的错误值 og:url:关键字 og:url 未注册”
“元素元上属性名称的错误值 og:site_name:关键字 og:site_name 未注册”
我发现元名称属性“og:xxxx”仅在链接到文章菜单项的页面上生成。不幸的是,首页链接到这样一个菜单项,我不知道“og:”部分来自。
我试图用谷歌搜索这个问题,我唯一能想到的是它与 Open Graph 有关。
我希望有人能帮我解决这个问题。
html - 禁用 HTML5 验证。如何在全局范围内为每个表单设置“novalidate”?
我想知道是否可以为我的应用程序中的每个表单禁用 HTML5 验证。
有什么办法可以做到这一点,或者我应该novalidate
为每个表单标签添加属性?
html - 如何模拟选择字段所需的
我也想模仿选择字段所需的内容。如果第一个选项为空,则必填字段适用于选择字段。但我仍然看不到“请填写此字段”的框
是否有一种技巧或一种方法可以将所需的框添加到选择字段中,类似于我们在 html5 中的输入字段