Keith Power
Keith Power

Reputation: 14141

jQuery update form element

I have a form that I create a checkbox on a click of a button. I am using https://github.com/pixelmatrix/uniform which provides an update function to style dynamically create elements which does not work. I got a work around but my problem is that it also reset the already created elements so they double, triple etc.

They are wrapped in a div with a class of checker. Is there a way to check if the div is around it first before applying my $('.table').find('input:checkbox').uniform(). I have tried different examples but they dont seem to work with my code and my jQuery is still limit.

Thanks

<div class="checker" id="uniform-160">
        <span>
            <input type="checkbox" name="chbox" id="160" style="opacity: 0;">
        </span>
 </div>

jQuery:

$(".fg-button").live("click", function(){
    $('.table').find('input:checkbox').uniform()
    });

Upvotes: 0

Views: 581

Answers (1)

Tim Rogers
Tim Rogers

Reputation: 21713

Try this:

$('.table input:checkbox').not('div.checker input').uniform()

Upvotes: 1

Related Questions