title: Click on button in Android WebView programmatically
body: <p>I am trying to fill in a few fields(Working) then click the login button(Not Working) I have tried:</p>
  
  <pre><code>document.getElementById('loginButton').click();"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>document.forms['form'].submit();
  </code></pre>
  
  <p>The button name and form name are correct, what am I doing wrong? </p>
  
  <pre><code>webview.setWebViewClient(new WebViewClient() {  
               @Override  
               public void onPageFinished(WebView view, String url)  
               {  
                   webview.loadUrl("javascript:(function() { " +  
                        "document.getElementById('coCode').value = 'CompanyCode';" +
                        "document.getElementById('loginName').value = 'LoginName';" +
                        "document.getElementById('password').value = 'Password';" +
                        //"document.forms['form'].submit();" + //Doesn't Work
                        //"document.getElementById('loginButton').click();" + //Doesn't Work
                      "})()");
               }  
           });
  </code></pre>