Wednesday, January 27, 2010

Handing Checkboxes with jQuery

To determine whether a specific checkbox has been checked:

if ($('#edit-checkbox-id:checked').val() !== null) { // Insert code here. }

Another variation:

var checked =
$('#edit-checkbox-id:checked').val() == 'on';

Courtesy of: http://drupal.org/node/116548

No comments:

Post a Comment