Reputation: 83
The following is signup.html
when a user fills the form fields then presses on the button or pressing the ENTER key nothing happens and Flask only shows the GET requests that were made to get the page before filling users
No POST request is being made
changing action="{{url_for('UI.signup')}}"
TO action='/signup'
does not fix the problem
{% block content%}
<section class="vh-100" style="background-color: #eee;">
<div class="container h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-lg-12 col-xl-11">
<div class="card text-black" style="border-radius: 25px;">
<div class="card-body p-md-5">
<div class="row justify-content-center">
<div class="col-md-10 col-lg-6 col-xl-5 order-2 order-lg-1">
<p class="text-center h1 fw-bold mb-5 mx-1 mx-md-4 mt-4">Sign up</p>
<form action="{{url_for('UI.signup')}}" method="POST" class="mx-1 mx-md-4" >
<div class="d-flex flex-row align-items-center mb-4">
<i class="fas fa-user fa-lg me-3 fa-fw"></i>
<div class="form-outline flex-fill mb-0">
<input name="username" type="text" id="form3Example1c" class="form-control" />
<label class="form-label" for="form3Example1c">Username</label>
</div>
</div>
<div class="d-flex flex-row align-items-center mb-4">
<i class="fas fa-envelope fa-lg me-3 fa-fw"></i>
<div class="form-outline flex-fill mb-0">
<input name="email" type="email" id="form3Example3c" class="form-control" />
<label class="form-label" for="form3Example3c">Email</label>
</div>
</div>
<div class="d-flex flex-row align-items-center mb-4">
<i class="fas fa-lock fa-lg me-3 fa-fw"></i>
<div class="form-outline flex-fill mb-0">
<input name='passwrd1' type="password" id="form3Example4c" class="form-control" />
<label class="form-label" for="form3Example4c">Password</label>
</div>
</div>
<div class="d-flex flex-row align-items-center mb-4">
<i class="fas fa-key fa-lg me-3 fa-fw"></i>
<div class="form-outline flex-fill mb-0">
<input name='passwrd2' type="password" id="form3Example4cd" class="form-control" />
<label class="form-label" for="form3Example4cd">Repeat your password</label>
</div>
</div>
<div class="d-flex justify-content-center mx-4 mb-3 mb-lg-4">
<button type="button" class="btn btn-primary btn-lg">Register</button>
</div>
</form>
</div>
<div class="col-md-10 col-lg-6 col-xl-7 d-flex align-items-center order-1 order-lg-2">
<img src="{{url_for('UI.static', filename='.jpg')}}" class="img-fluid" alt="Sample image">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock%}
I wish to use this exact html for the signin page but for some reason it is not creating post requests after filling the data
Upvotes: 0
Views: 27
Reputation: 944529
<button type="button" class="btn btn-primary btn-lg">Register</button>
type="button"
creates a button that doesn't do anything. It exists solely to hook JavaScript onto.
Take that out (type="submit"
is the default) and the button will submit the form when clicked.
Upvotes: 2