0

I want to make use of "onfocusout" at an input element. Unfortunately my validators return the following error message: "Attribute onfocusout not allowed on element input at this point."

The html code looks like this:

<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?

FernSeher
  • 177
  • 1
  • 13

1 Answers1

0

Note: The onfocusout event may not work as expected in Chrome, Safari and Opera 15+ using the JavaScript HTML DOM syntax. However, it should work as an HTML attribute and by using the addEventListener() method (See syntax examples below).

In JavaScript, using the addEventListener() method:

object.addEventListener("focusout", myScript);

Source

Rob Moll
  • 3,345
  • 2
  • 9
  • 15