Here is my HTML
<form class="form-horizontal" action="/" method="POST">
<div class="control-group">
<label class="control-label" for="email">Email</label>
<div class="controls">
<input type="text" id="email" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="password">Password</label>
<div class="controls">
<input type="password" id="password" placeholder="Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">Sign In</button>
</div>
</div>
</form>
When I submit form, on server I try to print it, I do
def post(self):
print 'data :', request.form
I get
data : ImmutableMultiDict([])
I also try
def post(self):
print 'data :', request.json
I get
data : None
What exactly I am missing here
None of your inputs have name attribute
Therefore, nothing sent.
<input type="password" id="password" placeholder="Password">
should be:
<input type="password" id="password" name="password" placeholder="Password">
ID is just for DOM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With