Send form inside function not working
<p>I'm trying to transform a ContentEditable area in a form element with Javascript, and after the Editable content loses focus, the form is automatically sent. For some reason, the javascript is not working with the two commands, and the form is not being sent. </p>

<p>JS:</p>

<pre><code>&lt;script&gt;
function sendform() {
  document.getElementById("search-hidden").value = document.getElementById("search").innerHTML;
  document.getElementById("myForm").submit();
}
&lt;/script&gt;
</code></pre>

<p>HTML:</p>

<pre><code>&lt;form id='Form' action='handle.php' method='post'&gt;
&lt;p id="search" contenteditable='true' onblur="sendform()"&gt;Search&lt;/p&gt;
&lt;input id='search-hidden' type='hidden' name='search-hidden'&gt;
&lt;/form&gt;
</code></pre>