Javascript prompt and submit
<p>I want to get a value from JavaScript prompt and pass it to input for finally submit it</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;form id="createdirForm"&gt;&lt;input type="text" name="" id="createdir"/&gt;&lt;form&gt;
</code></pre>

<p><strong>JavaScript</strong>        </p>

<pre><code>function createdir() {
    var newdirname;
    newdirname = prompt('Please input the directory name:', '');
    if (!newdirname) return;
    $('createdir').newdirname.value = newdirname;
    $('createdirForm').submit();
}
</code></pre>