title: How do I click Next button First step check Validation and second step Not check Validation?
body: <p>I make custom Wizard with validate but when I click Next button to First step check validation and when click next step click on next button it's not check validate and skip the step.</p>
  
  <p>HTML is as given below:</p>
  
  <pre><code>&lt;form&gt;
              &lt;div class="form-main"&gt;
                  &lt;div class="form-input"&gt;
                      &lt;input type="text" id="fname" placeholder="First Name"&gt;
                      &lt;p id="error"&gt;&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-input"&gt;
                      &lt;input type="text" id="lname" placeholder="Last Name"&gt;
                      &lt;p id="error"&gt;&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-input"&gt;
                      &lt;input type="email" id="email" placeholder="Email"&gt;
                      &lt;p id="error"&gt;&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-input"&gt;
                      &lt;input type="password" id="password" placeholder="Password"&gt;
                      &lt;p id="error"&gt;&lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="form-btn"&gt;
                      &lt;button type="button" id="prev" onClick="prevBtn(this);"&gt;prev&lt;/button&gt;
                      &lt;button type="button" id="next" onClick="nextBtn(this);"&gt;next&lt;/button&gt;
                      &lt;button type="submit" id="submit"&gt;submit&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;    
          &lt;/form&gt;
  </code></pre>
  
  <p>Script Below:
  separated function used update status means find index and update ,validation,next button and previous button.</p>
  
  <pre><code>$(window).on('load',function(){
      $('.form-main &gt; .form-input:nth-child(1)').addClass('open');
      $('.form-main &gt; .form-input:not(".open")').addClass('close').hide();    
  });
  
  var $div = $('.form-input');
  var submits = $('#submit').css('display','none');
  index = 0;
  
  function updateStatus(a){
      $div.eq(index).removeClass('current').addClass('close').hide();
      index += a;
  
      $div.eq(index).addClass('current').removeClass('close').show();
  
      $('#next').toggle((index !==$div.length-1));
      $('#prev').toggle(index !== 0); 
  
      if(index == ($div.length - 1)){
          submits.toggle(index !== 0);
      }else{
          submits.hide();
          }
  }
  
  var input = document.getElementsByTagName('input');
  var error = document.getElementById('error');
  
  function validation(){
      var inputValue = $(input).val();
      var inputType = $(input).attr('type');  
          if(inputValue !== ''){
              updateStatus(+1);
          }else{      
              error.innerHTML = "please enter the value";
          }
  }
  
  function nextBtn(){
      validation();
  }
  
  function prevBtn(){
      updateStatus(-1);
  }   
  </code></pre>