If cboMonth.SelectedItem = "กุมภาพันธ์" Then
If (cboYear.SelectedIndex - 1) Mod 4 = 0 Then
cboDate.Items.Clear()
cboDate.Items.Add("โปรดระบุ")
cboDate.SelectedIndex = 0
For i = 1 To 29
cboDate.Items.Add(i)
Next
ElseIf (cboYear.SelectedIndex - 1) Mod 4 <> 0 Then
cboDate.Items.Clear()
cboDate.Items.Add("โปรดระบุ")
cboDate.SelectedIndex = 0
For i = 1 To 28
cboDate.Items.Add(i)
Next
End If
ElseIf cboMonth.SelectedItem = "มกราคม" Or cboMonth.SelectedItem = "มีนาคม" Or cboMonth.SelectedItem = "พฤษภาคม" Or cboMonth.SelectedItem = "กรกฏาคม" Or cboMonth.SelectedItem = "สิงหาคม" Or cboMonth.SelectedItem = "ตุลาคม" Or cboMonth.SelectedItem = "ธันวาคม" Then
cboDate.Items.Clear()
cboDate.Items.Add("โปรดระบุ")
cboDate.SelectedIndex = 0
For i = 1 To 31
cboDate.Items.Add(i)
Next
ElseIf cboMonth.SelectedItem = "เมษายน" Or cboMonth.SelectedItem = "มิถุนายน" Or cboMonth.SelectedItem = "กันยายน" Or cboMonth.SelectedItem = "พฤศจิกายน" Then
cboDate.Items.Clear()
cboDate.Items.Add("โปรดระบุ")
cboDate.SelectedIndex = 0
For i = 1 To 30
cboDate.Items.Add(i)
Next
End If
End Sub
Tag : PHP, HTML/CSS, JavaScript, VBScript, Web (ASP.NET), VB.NET