ページが読み込まれたときにカレンダーを表示し、日付を選択して変数に割り当てる場所に問題があります。ユーザーは必要に応じて別の日付を選択できるため、日付を選択した後にカレンダーを非表示にしないでください。
これは私のhtmlです:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Date</title>
<script type="text/javascript" src="cal.js"></script>
</head>
<body>
<td width="65%" colspan="2" class="textfieldalign">
<input type="hidden" name="regddate" id="regddate" maxlength="10" >
<div id="datePi" ></div>
</td>
</body>
<script>
onLoadInitCalendar();
function onLoadInitCalendar(){
scwShow(document.getElementById('datePi'),'onClick','');return false;
}
</script>
</html>
私は使用cal.js
しましたが、ここにコードを貼り付けることができません。
カレンダーがどのように表示されるかのサンプルを次に示します。