하얀늑대 :: 하얀늑대의 일상
bloghome Tags |  Guestbook | 
  Tags
기획 환생 사랑 new 쇼핑몰 아이디어 Rss 위키 홍보 비즈니스모델 웹 접근성 주민등록번호 체크 IT 바탕화면 연애 sql 핸드폰 window2000 신조어 애완견
banner
하얀늑대 ::
하얀늑대의 일상

Google
내블로그에서 검색
 하얀늑대는?
 Category
allow  모두보기 (275)
spacespace Today Story's (11)
spacespace 핫이슈 (19)
spacespace 디카질 (4)
spacespace Javascript (15)
spacespace 2000 server (9)
spacespace 2003 server (3)
spacespace 리눅스 (3)
spacespace UCC (6)
spacespace 컴퓨터 Tip (15)
spacespace IT news (65)
spacespace 웹 접근성 (3)
 Tags
UCC 위키 textarea 사진 연애 입냄새 블루레이 투표 Office 강아지쏭 최적화 2003서버 고양이 function 프린터 분산서버 JavaScript 창업 월드컵 PCC
  Calendar
<< 2012 May >>
S M T W T F S
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2
 New Post
line 중국 오픈마켓 시장 진출
line 중국 오픈마켓 시장 진출
line 중국 인터넷 시장의 국제화
line 중국 인터넷 쇼핑몰 시장의
line 중국 인터넷, 바이러스 마
 New Comment
lineselee2000 : 10/10/27
reply멋진데요.
line클럽4242 : 10/08/26
reply사랑에상처는 사랑으로 치
linesusanna : 08/11/07
replyhey,find <a href=http:
line하얀늑대 : 08/05/22
reply위에 페이지는 한페이지 내
line아아아 : 08/04/26
reply개새끼는너야
 New Tracbacks
lineWeb 1.0 과 Web 2.0
line06/11/18
line괴물 - 2006. 7. 28.
line06/07/29
 New Archive
2011 April (13)
2011 March (2)
2011 January (1)
2010 December (1)
2010 November (1)
...more
  Link Site
올블로그
KOON
태터툴즈
엑스파이더
심프로그
디지털예보
thesimplog.com
feed rss
 Visitor Statistics
Total  :  336642
Today :  61
Yesterday :  90


 Google



blog bar tagsbar guest loginbarlogoutbarX-inbar
line 현재의 년도,월,일을 뿌려주는 select 박스
Javascript | 06/05/30 | 하얀늑대


<SCRIPT language="JavaScript">
<!--
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();

function DaysInMonth(WhichMonth, WhichYear)
{
        var DaysInMonth = 31;

        if (WhichMonth == "4월" || WhichMonth == "6월" || WhichMonth == "9월" || WhichMonth == "11월") DaysInMonth = 30;

        if (WhichMonth == "2월" && (WhichYear/4) != Math.floor(WhichYear/4))        DaysInMonth = 28;

        if (WhichMonth == "2월" && (WhichYear/4) == Math.floor(WhichYear/4))        DaysInMonth = 29;

        return DaysInMonth;
}

function ReOptionDays(Which)
{
        DaysObject = eval("document.Form1." + Which + "Day");
        MonthObject = eval("document.Form1." + Which + "Month");
        YearObject = eval("document.Form1." + Which + "Year");

        Month = MonthObject[MonthObject.selectedIndex].text;
        Year = YearObject[YearObject.selectedIndex].text;

        DaysForThisSelection = DaysInMonth(Month, Year);

        CurrentDaysInSelection = DaysObject.length;

        if (CurrentDaysInSelection > DaysForThisSelection)
        {
                for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
                {
                        DaysObject.options[DaysObject.options.length - 1] = null
                }
        }

        if (DaysForThisSelection > CurrentDaysInSelection)
        {
                for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
                {
                        NewOption = new Option(DaysObject.options.length + 1);
                        DaysObject.add(NewOption);
                }
        }

        if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}

function Today_getting(Which)
{

        DaysObject = eval("document.Form1." + Which + "Day");
        MonthObject = eval("document.Form1." + Which + "Month");
        YearObject = eval("document.Form1." + Which + "Year");


        YearObject[0].selected = true;
        MonthObject[NowMonth].selected = true;

        ReOptionDays(Which);

        DaysObject[NowDay-1].selected = true;
}

function WriteYearOptions(YearsAhead)
{
        line = "";

        for (i=0; i<YearsAhead; i++)
        {
                line += "<OPTION>";
                line += NowYear + i;
        }

        return line;
}
//-->
</SCRIPT>

<BODY onload="Today_getting('FirstSelect');">                    

 

<!--폼 환경설정 시작-->
<FORM name="Form1">
<SELECT name="FirstSelectYear" onchange="ReOptionDays('FirstSelect')">
<SCRIPT language="JavaScript">
<!--
document.write(WriteYearOptions(50));
-->
</SCRIPT>
</SELECT>년
<SELECT name="FirstSelectMonth" onchange="ReOptionDays('FirstSelect')">
        <OPTION>1월
        <OPTION>2월
        <OPTION>3월
        <OPTION>4월
        <OPTION>5월
        <OPTION>6월
        <OPTION>7월
        <OPTION>8월
        <OPTION>9월
        <OPTION>10월
        <OPTION>11월
        <OPTION>12월
</SELECT>
<SELECT name="FirstSelectDay">
        <OPTION>1일
        <OPTION>2일
        <OPTION>3일
        <OPTION>4일
        <OPTION>5일
        <OPTION>6일
        <OPTION>7일
        <OPTION>8일
        <OPTION>9일
        <OPTION>10일
        <OPTION>11일
        <OPTION>12일
        <OPTION>13일
        <OPTION>14일
        <OPTION>15일
        <OPTION>16일
        <OPTION>17일
        <OPTION>18일
        <OPTION>19일
        <OPTION>20일
        <OPTION>21일
        <OPTION>22일
        <OPTION>23일
        <OPTION>24일
        <OPTION>25일
        <OPTION>26일
        <OPTION>27일
        <OPTION>28일
        <OPTION>29일
        <OPTION>30일
        <OPTION>31일
</SELECT>
</FORM>
<!--폼 환결 설정 끝-->

 

 

이 글과 관련된 다른 글들
자바스크립트의 5가지 주요 객체
마우스를 클릭하면 미리 입력된 내용 지우기
입력란에 숫자만 입력할 수 있게 하기
입력한 문자의 공백없애주기
체크상자를 하나만 선택하게 하기
...more

태그: JavaScript,
bullet관련글0 | 댓글0
Name :   Pass :  URL :
비밀글로 등록  submit
이전/ 224 225 226 227 228 [229] 230 231 232 233 / 다음 top