feat: [지층색] : 보고서에 없는 경우, ‘-’ 선택 가능하도록 수정 요청

main
thkim 2025-07-07 14:19:18 +09:00
parent 85c85cf7a7
commit a6ca50c495
1 changed files with 29 additions and 2 deletions

View File

@ -15,6 +15,17 @@
// layout 조절.
$(".table_pop input").css("vertical-align", "-5px");
var colorNameInput = document.getElementById("colorName");
// "값 없음(-)" 라디오 버튼 클릭 시 다른 모든 라디오 버튼 uncheck
var value0Radio = document.getElementById("value0");
if (value0Radio) {
value0Radio.addEventListener("click", function() {
if (this.checked) {
colorNameInput.value = "-";
}
});
}
// 기존 선택된 값 체크 및 value
var beforeColorName = "${beforeColorName}";
if (beforeColorName != "") {
@ -29,7 +40,7 @@
}
$("input:radio[name='value" + (valueNum) + "']").filter("input[value='" + beforeColorName.charAt(i) + "']").attr("checked", true);
}
$("#colorName").val(beforeColorName);
$("#colorName").val(String(beforeColorName).replace('-',''));
} else {
// 없을 경우 갈색으로 기본 셋팅
$("input:radio[name='value2']").filter("input[value='갈']").attr("checked", true);
@ -45,7 +56,18 @@
}
}
$("#colorName").val(colorNameStr + "색");
if (event.target.getAttribute('id') === 'value0') {
colorNameInput.value = "-";
var allRadios = document.querySelectorAll("input[type='radio']");
allRadios.forEach(function(radio) {
if (radio.id !== "value0") {
radio.checked = false;
}
});
} else {
$("#colorName").val(String(colorNameStr).replace('-','') + "색");
value0Radio.checked = false;
}
});
resize();
@ -106,6 +128,11 @@
<td class="td_line" style="text-align: center;"><input type="radio" name="value3" id="value3" value="흑" /> 흑<br /> <input type="radio" name="value3" id="value3" value="갈" /> 갈<br /> <input type="radio" name="value3" id="value3" value="적" /> 적<br /> <input type="radio" name="value3" id="value3" value="황" /> 황<br /> <input type="radio" name="value3" id="value3" value="녹" /> 녹<br /> <input type="radio" name="value3" id="value3" value="청" /> 청<br /> <input type="radio" name="value3"
id="value3" value="백" /> 백</td>
</tr>
<tr>
<td colspan="3" class="td_line" style="text-align: center;">
<input type="radio" name="value0" id="value0" value="-" /><label for="value0" > 값 없음( - )</label>
</td>
</tr>
</table>
<div style="text-align: center; margin-top: 10px;">
지층색 : <input style="ime-mode: active;" type="text" name="colorName" id="colorName" value="" /> <a href="#" onClick="fn_layerColorInput(); return false;"><img src="/web/images/btn_pop_input.png" /></a> <a href="#" onclick="fn_layerColorClear()"><img src="/web/images/btn_pop_refresh.png" /></a>