jquery wizard
jquery wizard
I'm developing web page that has a form of a "wizard"(something like adding printer in Windows). I have 4 steeps, and I have two links at the bottom of a page, "Back" and "Next". Each time user click some of this links I have client script function(little of javascript, ajax and jquery) that is checking if user can move to next steep. My problem is that user can click, let say "Back" link, twice, fast. Each steep is <div> that is not visible, and div's are changing there's place on page on every click. it seams that user script can not finish checking everything for the first click, and then comes second click that lives those two div's visible...
I have tried document.ready function on click but no use...here is some code...
<a id="Back" href="#" onclick="$(document).ready(function(){LoadSteep(-1)})">Back</a>
<a id="Next" href="#" onclick="LoadSteep(1);">Next</a>
//links for next and back...argument is +1 or -1...
function LoadTeamsTree(e){
iTab=iTab+e;
switch(iTab){
case 0:
//function0 some jquery for fading out 1st div and fading in 2nd div, fading out links(next and back) if some of conditions are not fulfilled....some ajax to connect to database and setting div's content
break;
case 1:
//function1 some jquery for fading out 2nd div and fading in 3rd div, fading out links(next and back) if some of conditions are not fulfilled....some ajax to connect to database and setting div's content
//it goes on for 4 steeps
}
when user click on Back link twice fast, it seams that function(i) can not finish before second click, and then whole page becomes reorganized, both divs are visible...its a mess
How can I prevent(something like disable) link right after first click and enable it again after function(i) has finished....
thanks