переход на Главную страницу...


Cкачать Java скрипты
(1-100)

01   02   03   04   05  
06   07   08   09   10  
11   12   13   14   15  
16   17   18   19   20  
21   22   23   24   25  
26   27   28   29   30  
31   32   33   34   35  
36   37   38   39   40  
41   42   43   44   45  
46   47   48   49   50  
51   52   53   54   55  
56   57   58   59   60  
61   62   63   64   65  
66   67   68   69   70  
71   72   73   74   75  
76   77   78   79   80  
81   82   83   84   85  
86   87   88   89   90  
91   92   93   94   95  
96   97   98   99   100  

бесплатные шаблоны
javascript для html


Java скрипт - Кнопочный календарь

Содержимое этой таблицы поместите между <HEAD> и </HEAD>

 

<script language="JavaScript">

//Form button calendar (author unknown)
function setDate(str) {
if (str == " ") {
return;
}
mnth1 = document.forms[0].month.value;
mnth = mnth1;
mnth++;
year = document.forms[0].year.value;
dateStr = mnth+"/"+str+"/"+year;
dateStr = trim(dateStr);
document.forms[1].dateField.value = dateStr;
}
function trim(str) {
res="";
for(var i=0; i< str.length; i++) {
if (str.charAt(i) != " ") {
res +=str.charAt(i);
}
}
return res;
}
function getMonthName(mnth) {
if (mnth == 0) {
name = "Январь";
}else if(mnth==1) {
name = "Февраль";
}else if(mnth==2) {
name = "Март";
}else if(mnth==3) {
name = "Апрель";
}else if(mnth==4) {
name = "Май";
} else if(mnth==5) {
name = "Июнь";
} else if(mnth==6) {
name = "Июль";
} else if(mnth==7) {
name = "Август";
} else if(mnth==8) {
name = "Сентябрь";
} else if(mnth==9) {
name = "Октябрь";
} else if(mnth==10) {
name = "Ноябрь";
} else if(mnth==11) {
name = "Декабрь";
}
return name;
}
function getNoOfDaysInMnth(mnth,yr) {
rem = yr % 4;
if(rem ==0) {
leap = 1;
} else {
leap = 0;
}
noDays=0;
if ( (mnth == 1) || (mnth == 3) || (mnth == 5) ||
(mnth == 7) || (mnth == 8) || (mnth == 10) ||
(mnth == 12)) {
noDays=31;
} else if (mnth == 2) {
noDays=28+leap;
} else {
noDays=30;
}
return noDays;
}
function fillDates(dayOfWeek1,noOfDaysInmnth) {
for(var i=1; i<43; i++) {
str = "s"+i;
document.forms[0].elements[str].value=" ";
}
startSlotIndx = dayOfWeek1;
slotIndx = startSlotIndx;
for(var i=1; i<(noOfDaysInmnth+1); i++) {
slotName = "s"+slotIndx;
val="";
if (i<10) {
val = " "+i+" ";
} else {
val = i;
}
document.forms[0].elements[slotName].value = val;
slotIndx++;
}
}
function thisMonth() {
dt = new Date();
mnth = dt.getMonth(); /* 0-11*/
dayOfMnth = dt.getDate(); /* 1-31*/
dayOfWeek = dt.getDay(); /*0-6*/
yr = dt.getFullYear(); /*4-digit year*/
mnthName = getMonthName(mnth)+ " ";
document.forms[0].month.value = mnth;
document.forms[0].year.value = yr;
document.forms[0].currMonth.value = mnth;
document.forms[0].currYear.value = yr;
document.forms[0].monthYear.value = mnthName+yr;
document.forms[1].dateField.value = (mnth+1)+"/"+dayOfMnth+"/"+yr;
startStr = (mnth+1)+"/1/"+yr;
dt1 = new Date(startStr);
dayOfWeek1 = dt1.getDay(); /*0-6*/
noOfDaysInMnth = getNoOfDaysInMnth(mnth+1,yr);
fillDates(dayOfWeek1+1,noOfDaysInMnth);
}
function nextMonth() {
var currMnth = document.forms[0].month.value;
currYr = document.forms[0].year.value;
document.forms[0].prev.value='<<';
if (currMnth == "11") {
nextMnth = 0;
nextYr = currYr;
nextYr++;
} else {
nextMnth=currMnth;
nextMnth++;
nextYr = currYr;
}
mnthName = getMonthName(nextMnth);
document.forms[0].month.value=nextMnth;
document.forms[0].year.value=nextYr;
document.forms[0].monthYear.value= mnthName+" "+nextYr;
str = (nextMnth+1)+"/1/"+nextYr;
dt = new Date(str);
dayOfWeek = dt.getDay();
noOfDays = getNoOfDaysInMnth(nextMnth+1,nextYr);
fillDates(dayOfWeek+1,noOfDays); 
}
function prevMonth() {
var currMnth = document.forms[0].month.value;
currYr = document.forms[0].year.value;
if (currMnth == "0") {
prevMnth = 11;
prevYr = currYr;
prevYr--; 
} else {
prevMnth=currMnth;
prevMnth--;
prevYr = currYr;

}
str = (prevMnth+1)+"/1/"+prevYr;
dt = new Date(str);
dayOfWeek = dt.getDay();
runningMonth = document.forms[0].currMonth.value;
rMonth=runningMonth;
rMonth++;
runningYear = document.forms[0].currYear.value;
rYear=runningYear;
str = (rMonth)+"/1/"+rYear;
dt1 = new Date(str);
if (dt.valueOf() < dt1.valueOf()) {
alert('Этим скриптом не предусмотрен просмотр месяцев до текущего. \nВперед - пожалуйста! Хоть до Второго Пришествия!');
return;
}
mnthName = getMonthName(prevMnth);
document.forms[0].month.value=prevMnth;
document.forms[0].year.value=prevYr;
document.forms[0].monthYear.value= mnthName+" "+prevYr;
noOfDays = getNoOfDaysInMnth(prevMnth+1,prevYr);
fillDates(dayOfWeek+1,noOfDays);
if (document.forms[0].month.value == mnth){
document.forms[0].prev.value=' ';
}
}
</script>

 

Содержимое этой таблицы поместите между <BODY> и </BODY>

 

<body onload="thisMonth()">











<table border=2 bgcolor="#BAA0A0" align=center>
<tr>
<td align=center>
<form>
<!-- Hidden fields --->

<input type=hidden name=month value="">
<input type=hidden name=year value="">
<input type=hidden name=currMonth value="">
<input type=hidden name=currYear value="">


<!-- End of Hidden fields --->

<p>
<input type="button" style="width:21" name="prev" onclick="prevMonth()" 
value=" ">
<input type="text" size="15" name="monthYear" 
value="">
<input type="button" style="width:22" name="next" onclick="nextMonth()" value=">>">
</p>

<table bgcolor="#D4D4D4" align=center border="1" cellpadding="0" cellspacing="0" 
width="150">
<tr bgcolor="#10A0A0">
<td width="14%"><font face=verdana color=lime size="1"><strong>Пн</strong></font></td>
<td width="14%"><font face=verdana color=lime size="1"><strong>Вт</strong></font></td>
<td width="14%"><font face=verdana color=lime size="1"><strong>Ср</strong></font></td>
<td width="14%"><font face=verdana color=lime size="1"><strong>Чт</strong></font></td>
<td width="14%"><font face=verdana color=lime size="1"><strong>Пт</strong></font></td>
<td width="15%"><font face=verdana color=lime size="1"><strong>Сб</strong></font></td>
<td width="15%"><font face=verdana color=lime size="1"><strong>Вс</strong></font></td>
</tr>
<tr>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s1" value=" 1 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s2" value=" 2 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s3" value=" 3 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s4" value=" 4 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s5" value=" 5 "></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s6" value=" 6 "></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s7" value=" 7 "></td>
</tr>
<tr>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s8" value=" 8 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s9" value=" 9 "></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s10" value="10"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s11" value="11"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s12" value="12"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s13" value="13"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s14" value="14"></td>
</tr>
<tr>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s15" value="15"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s16" value="16"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s17" value="17"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s18" value="18"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s19" value="19"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s20" value="20"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s21" value="21"></td>
</tr>
<tr>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s22" value="22"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s23" value="23"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s24" value="24"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s25" value="25"></td>
<td align="center" width="14%"><input type="button"
onclick="setDate(this.value);"
name="s26" value="26"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s27" value="27"></td>
<td align="center" width="15%"><input type="button"
onclick="setDate(this.value);"
name="s28" value="28"></td>
</tr>
<tr>
<td align="center"><input type="button" name="s29"
onclick="setDate(this.value);"
value="29"></td>
<td align="center"><input type="button" name="s30"
onclick="setDate(this.value);"
value="30"></td>
<td align="center"><input type="button" name="s31"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s32"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s33"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s34"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s35"
onclick="setDate(this.value);"
value=" "></td>
</tr>
<tr>
<td align="center"><input type="button" name="s36"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s37"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s38"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s39"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s40"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s41"
onclick="setDate(this.value);"
value=" "></td>
<td align="center"><input type="button" name="s42"
onclick="setDate(this.value);"
value=" "></td>
</tr>
</table>
</form>
<form>
<table border=0 cellspacing=1 cellpadding=1>
<tr>
<td>
<b>Выбрано:</b>
</td>
<td align=center>
<input type=text size="12" name=dateField>
</td>
</table>
</form>

</td>
</tr>
</table>




      
Cкачать Java скрипты
(101-200)

101   102   103   104   105  
106   107   108   109   110  
111   112   113   114   115  
116   117   118   119   120  
121   122   123   124   125  
126   127   128   129   130  
131   132   133   134   135  
136   137   138   139   140  
141   142   143   144   145  
146   147   148   149   150  
151   152   153   154   155  
156   157   158   159   160  
161   162   163   164   165  
166   167   168   169   170  
171   172   173   174   175  
176   177   178   179   180  
181   182   183   184   185  
186   187   188   189   190  
191   192   193   194   195  
196   197   198   199   200  

скачать шаблоны
java script для html
  Книги   Скрипты     Анекдоты   Web Мастеру