title: js fill input fields
body: <p>I have a form with inputs, and I try to fill it's with javascript and submit the form</p>
  <p>Here <a href="http://avito.ru/additem" rel="nofollow noreferrer">http://avito.ru/additem</a></p>
  <p>Enter email, use code</p>
  <pre><code>   var e=document.querySelectorAll(&quot;[data-write-id=email]&quot;)[0];
     e.value=&quot;mail@imail.com&quot;; 
  </code></pre>
  <p>In form that appear at next step use code</p>
  <pre><code> e=document.querySelectorAll(&quot;[data-write-id=name]&quot;)[0];
   e.value=&quot;Mynameis&quot;;
   e=document.querySelectorAll(&quot;[data-write-id=phone]&quot;)[0];
   e.value=&quot;89999799991&quot;;
   e=document.getElementsByClassName(&quot;js-captcha-input&quot;)[0];
   e.value=&quot;s97jv&quot;; e=document.getElementsByClassName(&quot;js-submit&quot;)[1];
   e.click;
  
         
  </code></pre>
  <p><strong>And get errors when submit</strong></p>
  <blockquote>
  <p>enter your name</p>
  <p>enter your phone</p>
  <p>enter chapcha (that is not problem I know that capcha is wrong and it need to chage it value each time)</p>
  </blockquote>
  <p>I also try to use for each input the code to initialize functions that happens when user type letter but not work</p>
  <pre><code>  e.setfocus;
    e.click;
    e.change;
    e.mouseout;
    e.mouseenter;
    e.mouseleave;
    e.mousehover;
    e.mousedown;
    e.mouseup;
    e.mouseover;
    e.mousemove;
    e.onblur;
    e.oninput;
    e.keypress;
    e.keydown;
    e.keyup;
    e.focusout;
  </code></pre>
  <p><strong>In inspector I see that name and phone is empty send</strong></p>
  <blockquote>
  <p>Remote Address:225.79.82.192:443</p>
  <p>Request Method:POST</p>
  <p>Status Code:200 OK</p>
  <p>Request Headers</p>
  <p>Provisional headers are shown</p>
  <p>Accept:<em>/</em></p>
  <p>Content-Type:application/x-www-form-urlencoded; charset=UTF-8</p>
  <p>User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36</p>
  <p>X-Requested-With:XMLHttpRequest</p>
  <p>Form Dataview sourceview URL encoded</p>
  <p>source:add</p>
  <p>captcha:s97jv</p>
  <p>email:mail@mail.com</p>
  <p>private:1</p>
  <p>phone:</p>
  <p>name:</p>
  <p>Response Headers</p>
  </blockquote>
  <p>That code show message that input not filled &quot;Заполните поле&quot; translate &quot;please enter text&quot;</p>
  <pre><code>    t.prototype.checkFields = function () {
        var e = this,
        t = this.$container.find('.form-fieldset'),
        a = 0;
        return t.filter(':visible').each(function (t, i) {
          var s = $(i),
          n = s.find('input[type=&quot;text&quot;], input[type=&quot;password&quot;], input[type=&quot;email&quot;]'),
          r = n.data('write-id');
          - 1 === e.settings.emptyIgnoring.indexOf(r) &amp;&amp; n.length &amp;&amp; !n.prop('disabled') &amp;&amp; (n.val().trim() || (a++, s.addClass('is-js-error').find('.form-fieldset__error').html('Заполните поле'))) /*Заполните поле translate please enter text*/
        }),
        a
    },
  </code></pre>