Skip to main content

Bug Tracker

Side navigation

#13856 closed bug (notabug)

Opened May 05, 2013 11:21AM UTC

Closed May 06, 2013 04:25PM UTC

doesn't work .buttonset() on jQuery with wordpress

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.3
Keywords: Cc:
Blocked by: Blocking:
Description

I have a number of :checkbox elements that are initialized by a wordpress. Now i set .buttonset() function to #format but this is not work... like this sample: http://jqueryui.com/button/#checkbox

HTML:

<div id="format">
     <?php
     $categories = get_categories();
     foreach ($categories as $category) { ?>
     <input type="checkbox" name="check" value="<?php echo $category->cat_ID; ?>"/>
     <label><?php echo $category->cat_name;?></label><?php } ?>
     *//ADD STATIC HTML:*
     <input type="checkbox" id="id" /><label for="id">B</label>

</div>

jqUERY:

$('#format').buttonset();
$('input[type=checkbox]').removeClass('ui-helper-hidden-accessible');

$(':checkbox[name=check]').each(function( i ){
    var nameID = 'check'+ (i+1);
    this.id = nameID;
    $(this).next('label').prop('for', nameID); 
});

if i'm added a :checkbox element with static HTML it's worked well.

<input type="checkbox" id="id" /><label for="id">U</label>

and this is generated HTML:

<div id="format" class="ui-buttonset">
    <input type="checkbox" name="check" value="3" class="check" id="check1">
          <label for="check1">
          <span class="ui-button-text">CAT1</span>
          </label>      
    <input type="checkbox" name="check" value="4" class="check" id="check3">
          <label for="check3">
          <span class="ui-button-text">CAT2</span>
          </label>              
    <input type="checkbox" name="check" value="5" class="check" id="check4">
          <label for="check4">
          <span class="ui-button-text">CAT3</span>
          </label>              
     <input type="checkbox" id="id" class="">
          <label for="id" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right ui-corner-left" role="button" aria-disabled="false" aria-pressed="false">
          <span class="ui-button-text">B</span></label>

</div>

stackoverflow:

http://stackoverflow.com/questions/16381641/doesnt-work-buttonset-on-jquery

Attachments (0)
Change History (2)

Changed May 05, 2013 11:29AM UTC by mohammad.alvanpoor@yahoo.com comment:1

Changed May 06, 2013 04:25PM UTC by timmywil comment:2

resolution: → notabug
status: newclosed

Unfortunately, we are unable to assist with issues related to support or jQuery UI. Support can be found on the forums or on the #jquery irc channel. Bug reports related to jQuery UI can be filed on the jQuery UI bug tracker.