JavaScript version of date input control (1)

Source: Internet
Author: User
Tags date current time version visibility microsoft frontpage
Control

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta name= "generator" content= "Microsoft FrontPage 5.0" >
<meta name= "Author" content= "Zhaoweiwei" >
<meta name= "Keywords" content= "Birthday_input" >
<meta name= "Description" content= "date input Control" >
<script>
function showdb ()//Display control/hidden space
{
var currentdate=new Date ();
var cyear=currentdate.getfullyear ();
var cmonth=currentdate.getmonth ();
var cday=currentdate.getday ();

var A=document.getelementbyid ("Input_birth");

var Obj_year=document.getelementbyid ("year"); Automatically take the current time (client) when the control is expanded
Obj_year.innertext=cyear;
var Obj_month=document.getelementbyid ("month");
obj_month.innertext=cmonth+1;

var s=new Date (cyear,cmonth,1);
var startday=s.getday (); Date start number
var numdays=numberofdays (cmonth,cyear); Days of the Month
var day=document.getelementsbyname ("Day");
for (var j=1;j<=numdays;j++)//Insert Date
{
Day[startday+j-1].innertext=j;
}

if (a.style.visibility== ' visible ')
{
a.style.visibility= ' hidden ';
}
Else
{
a.style.visibility= ' visible ';
}

}
function Addyear ()
{
var Obj_year=document.getelementbyid ("year");
var Obj_month=document.getelementbyid ("month");

var Num_year=obj_year.innertext;



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.