2008/Jan/10

<SCRIPT language=JavaScript>
<!-- Begin
var bg_color = "bgcolor=#dddddd";
var bg_color_head = "bgcolor=#444444"
var now = new Date();
var month_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
document.write("<form name=date_list><table "+ bg_color +"><tr style='font-family:MS Sans Serif;font-size:8pt;'><td style='font-family:MS Sans Serif;font-size:8pt;'>");
document.write("<select name=month onchange=change_month(this.options.selectedIndex)>");
for(i=0;i<month_array.length;i++)
{
 if (now.getMonth() != i)
 {document.write ("<option value="+i+">"+month_array[i]);}
 else
 {document.write ("<option value="+i+" selected>"+month_array[i]);}

}
document.write("</select>");
document.write("</td><td>");
document.write ("<select name=year onchange=change_year(this.options[this.options.selectedIndex])>");
for(i=1950;i<3000;i++)
{
 if (now.getYear() != i)
 {document.write("<option value="+i+">"+(i+543));}
 else
 {document.write("<option value="+i+" selected>"+(i+543));}
}
document.write("</select></td></tr><tr style='font-family:MS Sans Serif;font-size:8pt;'><td colspan=2><center>");
document.write("<table bgcolor=white border=0 cellspacing = 0 cellpading = 0 width=100%><tr style='font-family:MS Sans Serif;font-size:8pt;' "+ bg_color_head +" align=center>");
document.write("<td><font color=yellow>M</font></td><td><font color=pink>T</td><td><font color=#00ff66>W</td><td><font color=orange>TH</td><td><font color=#CCF2FF>F</td><td ><font color=violet>S</td><td ><font color=red>S</td>");
document.write("</tr><tr style='font-family:MS Sans Serif;font-size:8pt;'>");
for(j=0;j<6;j++)
{
 for(i=0;i<7;i++)
 {
 document.write("<td style='font-family:MS Sans Serif;font-size:8pt;' align=center id=d"+i+"r"+j+"></td>")
 }
 document.write("</tr>");
}

document.write("</table>");

document.write("</center></from></td></tr></table>");

var show_date = new Date();

function set_cal(show_date)
{
begin_day = new Date (show_date.getYear(),show_date.getMonth(),1);
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getYear(),show_date.getMonth()+1,1);
count_day = (end_day - begin_day)/1000/60/60/24;
input_table(begin_day_date,count_day);
}
set_cal(show_date);

function input_table(begin,count)
{
init();
j=0;
if (begin!=0){i=begin-1;}else{i=6}
for (c=1;c<count+1;c++)
{
 colum_name = eval("d"+i+"r"+j);
 if ((now.getDate() == c)&&(show_date.getMonth() == now.getMonth())&&(show_date.getYear() == now.getYear())) {colum_name.style.backgroundColor = "#ff3399";colum_name.style.color = "white";};
 colum_name.innerText = c;
 i++;
 if (i==7){i=0;j++;}
}
}

function init()
{
for(j=0;j<6;j++)
{
 for(i=0;i<7;i++)
 {
 colum_name = eval("d"+i+"r"+j);
 colum_name.innerText = "-";
 colum_name.style.backgroundColor ="";
 colum_name.style.color ="";
 }
}
}

function change_month(sel_month)
{
show_date = new Date(show_date.getYear(),sel_month,1);
set_cal(show_date);
}

function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
// End -->
</SCRIPT>

2008/Jan/08

แท็ก HTML  JAVA   

 

<SCRIPT LANGUAGE="JavaScript">
<!--  Clock --
var timerID = null
var timerRunning = false
function stopclock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}
function startclock(){
    stopclock()
    showtime()
}
function showtime(){
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue  += (hours >= 12) ? "PM." : "AM."
    document.clock.face.value = timeValue
    timerID = setTimeout("showtime()",1000)
    timerRunning = true
}
//-->
</SCRIPT>

<body onLoad="startclock()">

<form name="clock" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=11 VALUE = "Please wait">
</form>

</body>

2007/Dec/20

<form>
TEXTBOX <BR>
<INPUT TYPE=”Text” NAME=”Text1”>
<BR>
RADIO BUTTON <BR>

<INPUT TYPE="RADIO" NAME="r1" VALUE="1" CHECKED>M <BR>
<INPUT TYPE="RADIO" NAME="r2" VALUE="1" >W
<BR>
CHECK BOX <BR>
<INPUT TYPE="CHECKBOX" NAME="checkbox1" VALUE="1" CHECKED><BR>
<INPUT TYPE="CHECKBOX" NAME="ìcheckbox2" VALUE="2" >
<BR>
TEXT BOX PASSWORD <BR>

Password :<INPUT TYPE="PASSWORD" NAME="password1 " SIZE="10" MAXLENGTH="10">
<BR>
 Submit  Reset <BR>

<INPUT TYPE="SUBMIT" NAME="1" VALUE="SUBMIT4"> 
<INPUT TYPE="RESET" NAME="2" VALUE="RESET5">

</form>

edit @ 20 Dec 2007 13:59:25 by ajarn