tabselectect - Force a tab
With :
jQuery 1.4.2
jQuery-ui-1.8rc3
I want, when selecting a new tab, if validation of the current tab fails, force the return to tab(0)
But the following code loops after line 8 switching the tabselect event
How can I write tis to avoid the loop ?
- $Onglets = $('#onglets').tabs();
- $('#onglets').bind('tabsselect', function(){
- var $curTab = $Onglets.tabs('option', 'selected');
- var $isValide = ...//form validation returning true or false
- if ((!$isVvalide) && ($curTab != 0)) {
- //Revenir à la page générale
- alert ('Forced Tab 0')
- $Onglets.tabs('select', 0);
- }
- });
Thanks for your help