ivana_andreevska

Wizard Step by Step

Nov 23rd, 2021
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.73 KB | None | 0 0
  1. $(document).ready(function () {
  2.     $("#section2 , #section3 , #section4").hide();
  3.     var currentSection=1;
  4.     $("#next").click(function (){
  5.         if(!validateData())
  6.         {
  7.             alert("Data not found");
  8.         }
  9.         if(currentSection<=3)
  10.         {
  11.             $("#section"+currentSection).hide();
  12.             currentSection++;
  13.             $("#section"+currentSection).show();
  14.         }
  15.     })
  16.  
  17.     $("#prev").click(function (){
  18.         if(currentSection>=2)
  19.         {
  20.             $("#section"+currentSection).hide();
  21.             currentSection--;
  22.             $("#section"+currentSection).show();
  23.         }
  24.     })
  25.  
  26.     function validateData()
  27.     {
  28.         var elD=$("#section"+currentSection);
  29.     }
  30. })
Advertisement
Add Comment
Please, Sign In to add comment