Я пытаюсь создать флажок на основе javascript, но почему-то не могу заставить его работать. Я создал вопрос ранее, но почему-то не смог добавить свой код в комментарии, поэтому создал новый вопрос. Вот что я сделал:
function eXcell_includeDC(cell) {
if (cell){ // the default pattern, just copy it
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}
this.getValue = regExpGetValueCell;
if (this.getValue = 'Y') {
var myDiv = document.getElementById("includeDC");
var checkbox = document.createElement("input");
checkbox.setAttribute("type", "checkbox");
checkbox.setAttribute("name", "dd");
checkbox.setAttribute("value", "ff");
checkbox.checked = true;
myDiv.appendChild(checkbox);
checkbox.checked = true;
} else {
var myDiv = document.getElementById("includeDC");
var checkbox = document.createElement("input");
checkbox.setAttribute("type", "checkbox");
checkbox.setAttribute("name", "dd");
checkbox.setAttribute("value", "ff");
checkbox.checked = true;
myDiv.appendChild(checkbox);
checkbox.checked = false;
}
this.isDisabled = function() {
return true;
}
this.setValue=function(val) {
// actual data processing may be placed here, for now we just set value as it is
this.setCValue(val);
}
}
eXcell_includeDC.prototype = new eXcell;