Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable custom checkboxes in Zurb Foundation?

Checkboxes are problematic with the latest Foundation (4.1.6) for many reasons. Is there an easy way to disable Foundation from taking them over? I need the custom class in my forms for other reasons. How do I get Foundation to leave my HTML checkboxes alone?

like image 747
at. Avatar asked May 23 '13 02:05

at.


2 Answers

I have not encountered a Foundation way of doing this, this is actually the first time I've heard this request.

You can achieve what you want by doing this:

// do this after you initialize foundation
$("form.custom").find('input[type="checkbox"]').each(function () {            
    $(this).removeClass('hidden-field');
    $(this).next('span.custom.checkbox').remove();
});
like image 103
von v. Avatar answered Nov 20 '22 09:11

von v.


An old post but for anyone trying this currently, there is a very easy way: data-customforms="disabled" works on any custom input as far as I can tell.

like image 2
Bobbzorzen Avatar answered Nov 20 '22 09:11

Bobbzorzen