 |
ฟังก์ชั้น วันเดือนปี function MonLen(Yr, Mo, Dy) นี่คือฟังก์ชัน วัน เดือน ปี ค่ะ อยากถามว่าถ้าจะเอามาเขียนเป็น list menu จะเขียนอย่วงไรค่ะ |
|
 |
|
|
 |
 |
|
function MonLen(Yr, Mo, Dy) { var Dol, K, DiM, NsI
DiM = LengthOfMonth(+Yr.options[Yr.selectedIndex].text,
Mo.selectedIndex+1)
Dol = Dy.options.length
if ( (NsI = Dy.selectedIndex) >= DiM ) NsI = DiM-1
// for (K=Dol ; K >DiM ; K--) Dy.options[K-1] = null
// for (K=Dol+1 ; K<=DiM ; K++) Dy.options[K-1] = new Option(K)
for (K=Dol ; K >DiM ; K--)
{ D_Opt[K] = Dy.options[K-1] ; Dy.options[K-1] = null }
for (K=Dol+1 ; K<=DiM ; K++) Dy.options[K-1] = D_Opt[K]
Dy.selectedIndex = NsI }
function DropReadYMD(Yr, Mo, Dy) {
var Y = + Yr.options[Yr.selectedIndex].text
var M = Mo.selectedIndex // 0..11
var D = Dy.selectedIndex + 1
return Y + '-' + Lz(M+1) + '-' + Lz(D) + ', ' +
Day3[new Date(Y, M, D).getDay()] }
function InitYMDselector(Yr, Mo, Dy, Anni, Base, SetObj) { var J
if (!Base) Base = new Date().getFullYear()
for (J=0; J<Anni; J++) Yr.options[J] = new Option(Base+J)
for (J=0; J<12 ; J++) Mo.options[J] = new Option(Mon3[J])
for (J=0; J<31 ; J++) Dy.options[J] = new Option(J+1)
if (SetObj) with (SetObj) {
Yr.selectedIndex = getFullYear()-Base
Mo.selectedIndex = getMonth()
Dy.selectedIndex = getDate()-1 }
else Yr.selectedIndex = Mo.selectedIndex = Dy.selectedIndex = 0
MonLen(Yr, Mo, Dy) }
.....................................................................
นี่คือฟังก์ชัน วัน เดือน ปี ค่ะ
อยากถามว่าถ้าจะเอามาเขียนเป็น list menu จะเขียนอย่วงไรค่ะ

Tag : - - - -
|
|
 |
 |
 |
 |
Date :
21 ธ.ค. 2550 11:19:23 |
By :
mai |
View :
1879 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|