jquery ui - JQueryUI Tabs Selection and Validation -
jquery ui - JQueryUI Tabs Selection and Validation -
i trying validate tab content(using ajax validation) before switching next tab. when user clicks on tab, current tab content sent server validation. , when result server received switch next tab. here code:
$('#tabs').tabs({ select: function(event, ui) { ... validate(currentindex, nextindex); homecoming false; } }); function validate(currentindex, nextindex){ $.ajax({ ... complete: function(){ $("#tabs").tabs('select', nextindex); } ... } }
you can see problem already, it's infinite loop, because validation causes tab's select handler causes validation , on. how solve without global variables?
thanks.
i'm not sure if work (haven't tried code) couldn't utilize .data(key,value) add together sort of "already validated" flag check for? add together if statement checks before entering validation function again.
jquery-ui jquery jquery-ui-tabs
Comments
Post a Comment