Skip to content
This repository
Browse code

toggleRadio must only search for inputs in 's form, not all over the DOM

  • Loading branch information...
commit 61066c52b64e102abf79ae29db06d24c4880d946 1 parent dd0e3ab
Vítor Avelino vitoravelino authored
4 vendor/assets/javascripts/foundation/jquery.foundation.forms.js
@@ -376,11 +376,11 @@
376 376
377 377 var toggleRadio = function($element) {
378 378 var $input = $element.prev(),
  379 + $form = $input.closest('form.custom'),
379 380 input = $input[0];
380 381
381 382 if (false === $input.is(':disabled')) {
382   -
383   - $('input:radio[name="' + $input.attr('name') + '"]').next().not($element).removeClass('checked');
  383 + $form.find('input:radio[name="' + $input.attr('name') + '"]').next().not($element).removeClass('checked');
384 384 if ( !$element.hasClass('checked') ) {
385 385 $element.toggleClass('checked');
386 386 }

0 comments on commit 61066c5

Please sign in to comment.
Something went wrong with that request. Please try again.