Bootstrap/Flask modal Bad Request for Post
<p>I am trying to get the contents of a modal input form with <code>Flask</code> and <code>Boostrap</code>. Most of the other responses for similar questions on SO talk about adding the path for <code>form action</code>, but that isn't solving this one. What is causing the issue here? </p>

<p>init.py</p>

<pre><code>from flask import Flask, render_template, request

app = Flask(__name__)
app.secret_key = "Some secret string here"
@app.route('/getname', methods=["GET", "POST"])
def getname():

    if request.method == "POST":
        print request.form['value of Id']
    return render_template("done.html")

if __name__ == "__main__":
    app.run(debug=True)
</code></pre>

<p>html modal form:</p>

<pre><code>&lt;div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog"&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
               &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                &lt;form method="post" role="form" action="/getname"&gt;
                    &lt;div class="form-group"&gt;
                        &lt;label for="Name" class="control-label"&gt;Name:&lt;/label&gt;
                        &lt;input type="text" class="form-control" id="Name"&gt;

                        &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                        &lt;a href="/getname"&gt;&lt;button type="submit" id="btnUpdate" class="btn btn-primary"&gt;Submit&lt;/button&gt;&lt;/a&gt;
                    &lt;/div&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>