Answer the question
In order to leave comments, you need to log in
After submitting the form, all the set properties go astray, how to fix it?
There is a form:
<form id="personal-form" action="" method="POST" role="form">
<input type="text" class="form-control req-input">
<input type="email" class="form-control req-input">
<input type="tel" class="form-control" placeholder="+ 380 (___) ___ __ __">
<button id="profile-sub" type="submit" class="btn btn-primary">СОХРАНИТЬ ИЗМЕНЕНИЯ</button>
</form>
$(document).ready(function() {
$("#personal-form").on("submit", function(e){
$("#test").css("border","5px solid red");
});
});
$(document).ready(function() {
$("#personal-form").on("submit", function(e){
$("#test").css("border","5px solid red");
return false;
});
});
Answer the question
In order to leave comments, you need to log in
The form is submitted - the page is refreshed.
And everything is logical.
So your page is then updated when it is sent. The default form doesn't care if the field is filled in or not. She immediately sends it, even if it is empty. You need to block the form first, all of it, check the fields are filled, and then send it. Not like you!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question