28 maj 2008

Odznaczenie elementu checkbox form elements

function off(id) {
  var id_p = 'id_page_' + id;

  if (document.forms[0].elements[id_p].checked)
    document.forms[0].elements[id_p].checked = false;
  else
    document.forms[0].elements[id_p].checked = true;
}