Reputation: 31347
The point is to toggle some fieldsets but, depending on the scenario you may have either one or two fieldsets active. This should work on both cases.
This works only if we have one fieldset appearing.
If you duplicate the fieldsets and test it again, you will notice that, if we have two fieldsets, the links that trigger should also change, but they don't, making the link text to be absurd.
Am I using the wrong tool for this job, or is it a logic issue on this code ?
Upvotes: 0
Views: 49
Reputation: 14882
The code is listening for someone to click on the button before it does anything. The simplest solution is to add an if statement at the bottom of your code:
if($('#localized fieldset').length > 1)
{
$(".trigger").toggle();
}
Upvotes: 1