<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>标签:出差,typeContentTextBox,checked,getElementById,12.6,申请单 From: https://www.cnblogs.com/dmx-03/p/17911946.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>出差申请单</title>
</head>
<body>
<h1>出差申请单</h1>
<form action="worker44.jsp" method="post">
<label for="destination">目的地:</label>
<input type="text" name="destination" id="destination" required>
<br><br>
<label for="departuredate">暂定出发日期</label>
<input type="date" name="departuredate" id="departuredate" min="<?php echo date('Y-m-d'); ?>" required>
<br><br>
<label for="returndate">预计返回日期</label>
<input type="date" name="returndate" id="returndate" min="<?php echo date('Y-m-d'); ?>" required>
<br><br>
<label>出差类别:</label>
<input type="radio" name="Type" id="businessNegotiation" value="businessNegotiation" required>
<label for="businessNegotiation">业务洽谈</label>
<input type="radio" name="Type" id="training" value="training" required>
<label for="training">培训</label>
<input type="radio" name="Type" id="meeting" value="meeting" required>
<label for="meeting">会议</label>
<input type="radio" name="Type" id="other" value="other" required>
<label for="other">其他</label>
<input type="text" name="Typecontent" id="Typecontent" placeholder="其他原因" disabled>
<script>
// JavaScript to enable/disable the text box based on the radio button selection
const otherRadioButton = document.getElementById('other');
const typeContentTextBox = document.getElementById('Typecontent');
otherRadioButton.addEventListener('change', function() {
typeContentTextBox.disabled = !this.checked;
if (this.checked) {
typeContentTextBox.focus();
}
});
</script>
<br><br>
<label for="Reason">出差事由:</label>
<textarea name="Reason" id="Reason" rows="4" cols="50" required></textarea>
<br><br>
<input type="submit" value="提交申请">
</form>
</body>
</html>