Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophervigliotti/f0a1fc3cdef629f65609 to your computer and use it in GitHub Desktop.
Save christophervigliotti/f0a1fc3cdef629f65609 to your computer and use it in GitHub Desktop.
Hacky Zurb Foundation 4 Checkbox Fixer
this.writeCheckbox = function(id,value){
var doCheck = true;
var isChecked = false;
var selector = '#' + id;
if(value == 0 || value == '' || value == undefined){
doCheck = false;
}
isChecked = $(selector).parent().children("span").hasClass("checked");
if((doCheck == true && isChecked == false) || (doCheck == false && isChecked == true)){
$(selector).click();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment