How do I check for validation?

Moderators, correct me RV

All Shalom! Want to do validation of fields I have a form that works in steps, how do I do if the field is empty then the next step is not to show?

It is necessary that all were validated except for input name

Here is the code jquery
$(document).ready(function () {
 var steps = $('form').children('.tab');
 var current_step = 0;
 $('form').click(function () {
 if (current_step >= steps.length - 2) {
 $("form button.signup").show();

<form id="regForm" action="" method="post">
 <div class="tab">
 <h4>Your phone number</h4>
 <p>Please confirm your country code and enter the phone number.</p>
 <div class="error">
 <span>Invalid phone number</span>
 <p><input type="text" name="phone" id="phone" placeholder="+380"></p>

 <div class="tab">
 <h4 id="title-phone"></h4>
 <p>We have sent you a message with activation code on your phone. Please enter it below.</p>
 <div class="error">
 <span>Invalid activation code</span>
 <p><input type="text" name="code" placeholder="Your code"></p>

 <div class="tab">
 <h4>Your information</h4>
 <p>Please enter your name and upload a photo.</p>
 <div class="photo">
 <div class="error">
 <span>Enter your name</span>
 <p><input type="text" placeholder="Name" id="firstname"></p>
 <p><input placeholder="last Name (optional)"></p>

 <button type="button" class="next">continue</button>
 <button type="button" class="signup" style="display: none;">REGISTER</button>

css won't throw, that makes no sense, the form itself works on the steps as I need, but I need to do validation, I can not understand how, I wish you showed me how to do it because I finished my code a bit, everyone will be grateful!
April 7th 20 at 15:22
1 answer
April 7th 20 at 15:24
if (step.eq(current_step).find('input').val().length === 0) {
 // show error
Thank you, what helped - Precious_Zemlak17 commented on April 7th 20 at 15:27

Find more questions by tags HTMLJavaScriptjQuery