Skip to main content

ActiveX sample source codes - Another month, day, year dropdown creator

<script language=javascript>
function fnSubmit(strPage)
{
  document.forms[0].action= strPage
  document.forms[0].submit()   
}

</script>
<%

'here is the call
writedropdowns

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub writeDropDowns()
  Dim strSelfLink
  strSelfLink = request.servervariables("SCRIPT_NAME")
  response.Write "<form name=dates method=post>" & vbcrlf
  response.Write MonthDropDown("month1",False,request("month1"),strSelfLink) & " " & DayDropDown("day1", "",getDaysInMonth(request("month1"),request("year1")),request("day1")) & " " & YearDropDown("year1","","", request("year1"),strSelfLink) & vbcrlf
  response.Write "</form>"    & vbcrlf
End Sub
       
'MonthDropDown
'strName = name of drop down
'blnNum = 'If blnNUM Is True, Then show As numbers
'strSelected = the currenct selected month
'strSelfLink = link to current page
Function MonthDropDown(strName, blnNum, strSelected, strSelfLink)
  Dim strTemp, i, strSelectedString           
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Month" & "</option>" & vbcrlf           
  For i = 1 To 12
    If strSelected = CStr(i) Then
    strSelectedString = "Selected"
    Else
    strSelectedString = ""
    End If
           
    If blnNum Then
      strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf           
    Else
    strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & MonthName(i) & "</option>" & vbcrlf           
    End If
  Next                   
  strTemp = strTemp & "</select>" & vbcrlf   
  MonthDropDown = strTemp
End Function

'YearDropDown
'strName = name of dropdown
'intStartYear = year to start options list
'intEndYear = year to end options list
'strSelected = the currenct selected year
'strSelfLink = link To currentpage
Function YearDropDown(strName, intStartYear, intEndYear, strSelected, strSelfLink)
 
  Dim strTemp, i, strSelectedString   
 
  If intStartYear = "" Then
    intStartYear = Year(now())
  End If   
   
  If intEndYear = "" Then
    intEndYear = Year(now()) + 9
  End If
   
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf           
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Year" & "</option>" & vbcrlf           
  For i = intStartYear To intEndYear       
    If strSelected = CStr(i) Then
      strSelectedString = "Selected"
    Else
      strSelectedString = ""
    End If
    strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf                           
   Next                   
   strTemp = strTemp & "</select>" & vbcrlf   
   YearDropDown = strTemp
End Function

'DayDropDown
'strName = name of drop down
'intStartDay = day to start with
'intEndDay = day to end with
'strSelected = current slected day
Function DayDropDown(strName, intStartDay, intEndDay, strSelected )
    Dim strTemp, i, strSelectedString   
    If intStartDay = "" Then
      intStartDay = 1
    End If   
   
    If intEndDay = "" Then
      intEndDay = getDaysInMonth(Month(now()),Year(now()))
    End If
   
    strTemp = "<select name='" & strName& "'>" & vbcrlf           
    strTemp = strTemp & "<option value='" & 0 & "'>" & "Day" & "</option>" & vbcrlf           
    For i = intStartDay To intEndDay
      If strSelected = CStr(i) Then
        strSelectedString = "Selected"
      Else
        strSelectedString = ""
      End If
      strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf                           
    Next                   
    strTemp = strTemp & "</select>" & vbcrlf   
    DayDropDown = strTemp
End Function

'getDaysInMonth
'strMonth = month as number
'strYear = year
Function getDaysInMonth(strMonth,strYear)
        Dim strDays   
    Select Case CInt(strMonth)
        Case 1,3,5,7,8,10,12:
        strDays = 31
        Case 4,6,9,11:
           strDays = 30
        Case 2:
        If  ( (CInt(strYear) Mod 4 = 0  And  CInt(strYear) Mod 100 <> 0)  Or ( CInt(strYear) Mod 400 = 0) ) Then
          strDays = 29
        Else
          strDays = 28
        End If   
        'Case Else:
    End Select
       
    getDaysInMonth = strDays
End Function   
%>

Popular posts from this blog

AGRICULTURAL SCIENTIST RECRUITMENT BOARD

Agricultural Research Service

National
Eligibility Test/ Senior Research Fellowship Examination 

The Agricultural Scientists Recruitment Board (ASRB)
 holds a Competitive Examination for recruiting Scientists of the ARS in the pay scale of Rs. 8,000-13,500 in the ICAR Institutes, combined with National Eligibility Test (NET) for recruitment of Lecturers and Assistant Professors by the State Agricultural Universities (SAUS) and for award of ICAR Senior Research Fellowships.

The selected candidates for Agricultural Research Service must serve in the institutes to which they are posted until they find appointment for higher positions through selection at other institutes.

(i) Candidates successful in ARS are appointed as Scientists in the Indian Council of Agricultural Research in the pay scale of Rs. 8,000-13,500.

(ii) Candidates clearing the National Eligibility Test are recommended to various State Agricultural Universities who will consider them for appointment as Lecturers or Assistant Pro…

CIVIL SERVICES' (I.A.S.) EXAMINATION

The Union Public Service Commission (U.P.S.C.) conducts Civil Services' Examination once a year in two stages. The Preliminary Examination (Objective Type) for selection of candidates for the Main Examination is held in the month of May.

The Civil Services Main Examination
 is held in the months of October/November. Blank application forms and other particulars are published in the Employment News, generally in the month of December.

The last date for the submission of applications to the Secretary, Union Public Service Commission, Dholpur House, Shahjahan Road, NewDelhi-11001 1 is usually the last week of January of the year of examination.

The Combined Civil Services Examination is conducted for Recruitment to the following Services/Posts:

1. Indian Administrative Service.
2. Indian Foreign Service.
3. Indian Police Service.
4. Indian P & T Accounts & Finance Service, Group 'A'.
5. Indian Audit and Accounts Service, Group 'A'.
6. Indian Customs and Central Excise S…

HSC Exam Time Table 2013 Arts, Commerce, Science

HSC Exam Time Table 2013:- Date: 21 Feb 2013 (Thursday)

Paper: (Marathi / Gujarati / Kannada / Sindi / Malyalam / Tamil / Telugu / Punjabi / Bengali
Time: 11.00 am to 2.00 pm

Date: 22 Feb 2013 (Friday)

Paper: Hindi
Time: 11.00 am to 2.00 pm
Paper: German / Andhramagadhi / Persian
Time: 3.00 am to 6.00 pm

Date: 23 Feb 2013 (Saturday)

Paper: English
Time: 11.00 am to 2.00 pm

Date: 25 Feb 2013 (Monday)

Paper: Secretarial Practice
Time: 11.00 am to 2.00 pm
Paper: Physics
Time: 11.00 am to 2.00 pm
Paper: Political Science
Time: 3.00 am to 6.00 pm

Date: 27 Feb 2013 (Wednesday)

Paper: Book Keeping & Accoutancy
Time: 11.00 am to 2.00 pm
Paper: Chemistry (will Be held on 26 March)
Time: 11.00 am to 2.00 pm
Paper: Philosophy
Time: 3.00 am to 6.00 pm

Date: 1 March 2013 (Friday)

Paper: Mathematics & Statistics Paper (Revised)
Time: 11.00 am to 2.00 pm
Paper: Mathematics & Statistics - I (Commerce)
Time: 11.00 am to 1.00 pm
Paper: Sociology
Time: 3.00 am to 6.00 pm

Date: 2 March 2013 (Saturd…