LoRa Packet Forwarder 单选按钮修改

This commit is contained in:
xusd 2024-07-31 11:09:02 +08:00
parent c53d3348af
commit ad41584915

View File

@ -303,6 +303,22 @@
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
$(document).ready(function (){
var readyRadioValue = $('input[name=mqttKeep][checked]').val();
console.log(readyRadioValue)
checkRadio(readyRadioValue);
$('.mqttKeep').on('ifChecked', function(event){
var radio = $(event.target).val();
checkRadio(radio);
})
})
function checkRadio(value){
if (value === '1'){
document.getElementById('mqttHeartbeat').style.display = 'block';
}else {
document.getElementById('mqttHeartbeat').style.display = 'none';
}
}
var prefix = ctx + "lora/agreement";
$("#form").validate({
focusCleanup: true
@ -346,9 +362,6 @@
$.operate.save(prefix + "/edit", form);
}
}
</script>
</body>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
// DOM完全加载和解析完成后执行的代码
cleanDiv()
@ -367,4 +380,5 @@
document.getElementById('agreement4').style.display = 'none';
document.getElementById('agreement5').style.display = 'none';
}
</script>
</script>
</body>