简体   繁体   English

验证错误:此时元素输入上不允许使用 onfocusout 属性

[英]Validation error: Attribute onfocusout not allowed on element input at this point

I want to make use of "onfocusout" at an input element.我想在输入元素上使用“onfocusout”。 Unfortunately my validators return the following error message: "Attribute onfocusout not allowed on element input at this point."不幸的是,我的验证器返回以下错误消息:“此时元素输入上不允许使用 onfocusout 属性。”

The html code looks like this: html 代码如下所示:

<div  class="form-group">
  <label  for="dbHost"  class="control-label col-sm-4">DB-Server</label>
  <div  class="col-sm-10">
    <input  type="text" class="form-control" id="dbHost" name="dbHost" onfocusout="validateForm();" value="db">
  </div>
<div>

Any idea?任何想法?

Note: The onfocusout event may not work as expected in Chrome, Safari and Opera 15+ using the JavaScript HTML DOM syntax.注意:使用 JavaScript HTML DOM 语法的 Chrome、Safari 和 Opera 15+ 中,onfocusout 事件可能无法正常工作。 However, it should work as an HTML attribute and by using the addEventListener() method (See syntax examples below).但是,它应该用作 HTML 属性并使用 addEventListener() 方法(请参阅下面的语法示例)。

In JavaScript, using the addEventListener() method:在 JavaScript 中,使用 addEventListener() 方法:

object.addEventListener("focusout", myScript);

Source资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 验证错误:“此时元素输入不允许属性只读。” - Validation error: “Attribute readonly not allowed on element input at this point.” 此时不允许对元素输入进行属性捕获 - Attribute capture not allowed on element input at this point W3C验证错误:“目前,元素meta上不允许使用属性名称。” - W3C validation error: “Attribute name not allowed on element meta at this point.” HTML 5验证失败,因为“此时元素a上不允许属性addthis:url”。 - HTML 5 Validation fails for “Attribute addthis:url not allowed on element a at this point.” W3C验证:此时元素a上不允许属性alt - W3C Validation: Attribute alt not allowed on element a at this point 您好,我收到关于 img 的 HTML 代码错误 — 此时元素输入上不允许使用属性 img - Hello, I'm receiving an HTML code error regarding img — Attribute img not allowed on element input at this point 错误:目前,元素li上不允许使用属性audio_url - Error: Attribute audio_url not allowed on element li at this point 目前,元素视频上不允许使用属性类型。 如何解决这个错误? - Attribute type not allowed on element video at this point. how to fix this error? 此时元素img上不允许使用属性img。 - Attribute img not allowed on element img at this point.Error 此时,元素按钮上不允许使用属性href - Attribute href not allowed on element button at this point
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM