• 1000 Выпадающий список должен иметь возможность настраивать только после того, как флажок = установлен. и также есть кнопка «Применить», но в этом коде я не добавлен «Пожалуйста, помогите мне», и я пробовал это.
function validate() {
var prefix = "chkdd";
var e1;
for (var i = 1; e1 = document.getElementById(prefix + i).length; i++) {
if (e1.checked == "") {
alert("Please enable check box");
e1.focus();
return false;
}
if (!e1.checked == "") {
return true;
}
}
}
function selectOrgChildRec(ctrl) {
$(ctrl).closest('tr').toggleClass('highlighted');
}
.highlighted {
background-color: #66CDAA;
}
tr {
background-color: red;
}
tr:hover {
background-color: yellow;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<table border=1>
<tr>
<td>
<input type="checkbox" id="chkdd1" onclick='selectOrgChildRec(this)' /></td>
<td>
<select id="DDL1" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL2" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL3" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL4" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL5" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL6" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="chkdd1" onclick='selectOrgChildRec(this)' /></td>
<td>
<select id="DDL1" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL2" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL3" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL4" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL5" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL6" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="chkdd1" onclick='selectOrgChildRec(this)' /></td>
<td>
<select id="DDL1" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL2" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL3" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL4" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL5" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL6" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="chkdd1" onclick='selectOrgChildRec(this)' /></td>
<td>
<select id="DDL1" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL2" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL3" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL4" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL5" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select id="DDL6" onchange="validate(this)">
<option>yes</option>
<option>no</option>
</select>
</td>
</tr>
</table>