Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>stating this with plain javascript would be pure pain :) i suggest using jQuery, eg:</p> <pre><code>$(':checkbox').click(function() { var checkbox = $(this); var row = checkbox.closest('tr'); var inputText = $('input[type=text]', row); if (checkbox.is(':checked')) { inputText.attr('readonly', 'readonly'); } else { inputText.removeAttr('readonly'); } }); </code></pre> <p>otherwise</p> <pre><code>function HandleClickOnCheckbox() { var checkbox = this; var row; var iter = checkbox; while (!row) { iter = iter.parent; if (iter == window) { break; } if (iter.tagName == 'tr') { row = iter; break; } } if (!row) { alert('row not found'); return false; } var textBoxes = GetTextBoxes(row); var method; if (checkbox.checked) { var disabledAttribute = document.createAttribute('disabled'); disabledAttribute.nodeValue = 'disabled'; method = function(textBox) { textBox.setAttributeNode(disabledAttribute); }; } else { method = function(textBox) { textBox.removeAttribute('disabled', 0); } } for (var i = 0; i &lt; textBoxes.length; i++) { var textBox = textBoxes[i]; method(textBox); } } function GetTextBoxes(element) { var textBoxes = new Array(); for (var i = 0; i &lt; element.children.lenght; i++) { var child = element.children[i]; if (child.tagName == 'input') { if (child.type == 'text') { textBoxes.push(child); } } if (child.tagName == 'td') { var childTextBoxes = GetTextBoxes(child); if (childTextBoxes.length) { for (var j = 0; j &lt; childTextBoxes.length; j++) { var childTextBox = childTextBoxes[j]; textBoxes.push(childTextBox); } } } } return textBoxes; } </code></pre> <p>this is not tested!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload