Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't make reset select works

I am developing a website where I need to reset my form, which is build with jQuery Uniform, but the issue is that I can't make any reset.

This is my header code:

$j(function() 
{
    // Binds all buttons and events 
    $j('#changecountry').click(countryPopup);
    $j('#catalogsearch').click(toggleSearch);
    $j('#closesearch').click(toggleSearch);

    /* Centers content on page according to phone width */
    centerContent('.header-links', '.header-links ul');
    centerContent('.footer-links', '.footer-links ul');

    /* Other instancing */
    $j('select').uniform({
        resetSelect:    '.reset'
    });

    $j('input[type=radio]').uniform();
    $j('input[type=checkbox]').uniform();
    activateLinks();
    arrow_position();
    front_page_accordion();

});

The next part is the form which looks like this:

<select class="uniform gift-layer" name="cost" id="cost">
<option value="0"><?php echo $this->__('What is your price range?'); ?></option>
<?php foreach($prices as $price) : ?>
    <option value="<?php echo $price['value']; ?>"><?php echo $price['label']; ?></option>
<?php endforeach; ?>
</select>

Is there anybody who can tell me what is wrong?

like image 328
user1746921 Avatar asked Nov 12 '22 20:11

user1746921


1 Answers

$j('select').uniform({
    resetSelector:    '.reset'
 });

instead of

$j('select').uniform({
        resetSelect:    '.reset'
});

Source: http://uniformjs.com/#resetSelector

like image 77
Maktouch Avatar answered Dec 05 '22 19:12

Maktouch