JavaScript 견적 or 주문 Form 작업때 예약일자 쉽게 꾸미기 [미완성]
페이지 정보
본문
소스 코드가 완성되지 않은 미완성 상태입니다. 서둘러 완성해 보겠습니다. ^^
test.html 문서 내용
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function setYearValue(target) {
var current = new Date();
var YEAR = current.getFullYear();
document.write("<option value=" + YEAR + ">" + YEAR + "</option>");
document.write("<option value=" + (YEAR + 1) + ">" + (YEAR + 1) + "</option>");
target.value = YEAR;
}
function setMonthValue(target) {
var current = new Date();
var MONTH = current.getMonth() + 1;
for(var i = 0; i < 12; i++) {
if(i < 9) var j = (i + 1);
else var j = i + 1;
document.write("<option value=" + j + ">" + j + "</option>");
}
target.value = MONTH;
}
function setDateValue(target) {
var current = new Date();
var YEAR = current.getFullYear();
var MONTH = current.getMonth() + 1;
var daysInMonth = new Date(new Date(YEAR, MONTH, 1) - 86400000).getDate();
for(var i = 0; i < daysInMonth; i++) {
if(i < 9) var j = (i + 1);
else var j = i + 1;
document.write("<option value=" + j + ">" + j + "</option>");
}
target.value = current.getDate();
}
//-->
</script>
</head>
<body>
<select name='receiptYear' style='width:60px;'>
<script language="JavaScript" type="text/javascript">
<!--
setYearValue(document.orderForm.receipt_year)
//-->
</script>
</select>년
<select name='receiptMonth' style='width:45px;'>
<script language="JavaScript" type="text/javascript">
<!--
setMonthValue(document.orderForm.receipt_month)
//-->
</script>
</select>월
<select name='receiptDay' style='width:45px;'>
<script language="JavaScript" type="text/javascript">
<!--
setDateValue(document.orderForm.current.getDate)
//-->
</script>
</select>일
</body>
</html>
두번째 방법에 대한 고찰
<select name="arrive_year" id="arrive_year" onChange="javascript:FindStartArea(this);">
<!--<option value="">-년-</option>-->
<?
for($gg = $toyear;$gg<=$toyear+1 ; $gg++)
{
if($gg == $toyear)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>년
<select name="arrive_month" id="arrive_month" onChange="javascript:FindStartArea(this);">
<!--<option value="">-월-</option>-->
<?
for($gg = 1;$gg<=12 ; $gg++)
{
if($gg == $tomonth)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>월
<select name="arrive_day" id="arrive_day" onChange="javascript:FindStartArea(this);">
<!--<option value="">-일-</option>-->
<?
for($gg = 1;$gg<=31 ; $gg++) {
if($gg == $today)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>일
<select name="arrive_hour" id="arrive_hour" onChange="javascript:FindStartArea(this);">
<!--<option value="">-시간-</option>-->
<?
for($gg = 0;$gg<=23 ; $gg++)
{
echo "<option value='$gg'>$gg</option>";
}
?>
</select>시
test.html 문서 내용
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function setYearValue(target) {
var current = new Date();
var YEAR = current.getFullYear();
document.write("<option value=" + YEAR + ">" + YEAR + "</option>");
document.write("<option value=" + (YEAR + 1) + ">" + (YEAR + 1) + "</option>");
target.value = YEAR;
}
function setMonthValue(target) {
var current = new Date();
var MONTH = current.getMonth() + 1;
for(var i = 0; i < 12; i++) {
if(i < 9) var j = (i + 1);
else var j = i + 1;
document.write("<option value=" + j + ">" + j + "</option>");
}
target.value = MONTH;
}
function setDateValue(target) {
var current = new Date();
var YEAR = current.getFullYear();
var MONTH = current.getMonth() + 1;
var daysInMonth = new Date(new Date(YEAR, MONTH, 1) - 86400000).getDate();
for(var i = 0; i < daysInMonth; i++) {
if(i < 9) var j = (i + 1);
else var j = i + 1;
document.write("<option value=" + j + ">" + j + "</option>");
}
target.value = current.getDate();
}
//-->
</script>
</head>
<body>
<select name='receiptYear' style='width:60px;'>
<script language="JavaScript" type="text/javascript">
<!--
setYearValue(document.orderForm.receipt_year)
//-->
</script>
</select>년
<select name='receiptMonth' style='width:45px;'>
<script language="JavaScript" type="text/javascript">
<!--
setMonthValue(document.orderForm.receipt_month)
//-->
</script>
</select>월
<select name='receiptDay' style='width:45px;'>
<script language="JavaScript" type="text/javascript">
<!--
setDateValue(document.orderForm.current.getDate)
//-->
</script>
</select>일
</body>
</html>
두번째 방법에 대한 고찰
<select name="arrive_year" id="arrive_year" onChange="javascript:FindStartArea(this);">
<!--<option value="">-년-</option>-->
<?
for($gg = $toyear;$gg<=$toyear+1 ; $gg++)
{
if($gg == $toyear)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>년
<select name="arrive_month" id="arrive_month" onChange="javascript:FindStartArea(this);">
<!--<option value="">-월-</option>-->
<?
for($gg = 1;$gg<=12 ; $gg++)
{
if($gg == $tomonth)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>월
<select name="arrive_day" id="arrive_day" onChange="javascript:FindStartArea(this);">
<!--<option value="">-일-</option>-->
<?
for($gg = 1;$gg<=31 ; $gg++) {
if($gg == $today)
echo "<option value='$gg' selected>$gg</option>";
else
echo "<option value='$gg'>$gg</option>";
}
?>
</select>일
<select name="arrive_hour" id="arrive_hour" onChange="javascript:FindStartArea(this);">
<!--<option value="">-시간-</option>-->
<?
for($gg = 0;$gg<=23 ; $gg++)
{
echo "<option value='$gg'>$gg</option>";
}
?>
</select>시
댓글목록
등록된 댓글이 없습니다.