Skip to content

Instantly share code, notes, and snippets.

@robotlolita
Created January 24, 2011 18:01
Show Gist options
  • Save robotlolita/793618 to your computer and use it in GitHub Desktop.
Save robotlolita/793618 to your computer and use it in GitHub Desktop.
function contains(obj, value) {
return obj && obj.indexOf(value) != -1
}
var checked = contains(sd_o, sd[i].id) // must be false or null to disable
var formElm = new Element('input', {'type': 'checkbox'
,'name': 'sideDish[]'
,'id': 'sideDish_' + sd[i].id
,'value': sd[i].id
,'checked': checked})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment