title: Webview android submit form
body: <p>I just started using Android Studio (few hours ago).
  I created a html form on a web site and i load it via webview.
  But the submit button doesn't do anything. Form method is POST.
  i tried using javascript function to submit form but it didnt work (it works in browser).</p>
  
  <p>HTML Form:</p>
  
  <pre><code>&lt;form name="mt" id="mt" action="http://mywebsite.com/process.php" method="post"&gt; 
  &lt;textarea name="tekst"&gt;&lt;/textarea&gt;&lt;br /&gt;
  &lt;input name="sav" type="radio" value="1" /&gt;save
  &lt;input name="sav" type="radio" value="2" /&gt;preview&lt;br&gt;
   &lt;a href="javascript: submitform()"&gt;Submit&lt;/a&gt; 
   &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function submitform()
  {
      document.forms["mt"].submit();
  }
  </code></pre>
  
  <p>and this is under <code>public class MainActivity extends ActionBarActivity</code></p>
  
  <pre><code>private WebView mWebView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mWebView = (WebView) findViewById(R.id.activity_main_webview);
  // Enable Javascript
          WebSettings webSettings = mWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
          mWebView.setWebChromeClient(new WebChromeClient());
          mWebView.setWebViewClient(new WebViewClient());
          mWebView.loadUrl("http://website.com/form.php");
  
      }
  </code></pre>
  
  <p>Would be extremely grateful for some insight!</p>