SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    calendar problems need help

    i create a calendar with weeks and month view and in the top of this calendar i create text box.when any date write in this text box the calendar is automatically update, now my problem is that i need when any date click in month view that date is automatically print in that text box.
    i want that when any date is selected this date is write in this text box. . . .
    plz guide me and send me the coding. . .
    Thanks in advance.
    shaker Aman new asp student

  2. #2
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ******** This is my calendar coding in asp classic **********



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <!-- **************** js ********** -->

    <link rel="stylesheet" href="style1.css" type="text/css" media="screen" />


    <!--
    <form id="jform" action="">


    Dateinput type="text" name="first" id="first" value="<%=sDate%>" /><pre> (mm-dd-yyyy)</pre>
    <br/><button type="submit" id="send" >submit</button>
    </form>-->



    <script type="text/javascript" src="jQuery.js" charset="utf-8"></script>

    <script type="text/javascript" src="function.js" charset="utf-8"></script>
    <!-- ************************* end **************************** -->
    <%
    dim sDate, currWeekDay, offsetWeekDay, firstWeekDate, endWeekDate, row,arrweekdayname
    sDate = request.Form("first")
    'Response.Write(sDate & "<BR>")
    if len(sDate) = 0 then
    sDate = date

    end if
    sDate = CDate(sDate)
    %>

    <!--<form action="maincopy.asp" method="post">
    Date: <input type="text" name="txtDate" id="txtDate" value="<%=sDate%>" /> &nbsp;&nbsp;&nbsp;(date formate i.e. mm/dd/yyyy) <br />
    <input type="submit" name="btnSubmit" id="btnSubmit" title="Click Here to enter any Day" value="Submit" />
    </form>-->
    <form id="jform" action="maincopy1.asp" method="post">


    Dateinput type="text" name="first" id="first" value="<%=sDate%>" /><pre>(mm-dd-yyyy)</pre>
    <br/><button type="submit" id="send" >submit</button>
    </form>


    <!--<a href="htmlfile.asp">html</a>-->
    <%
    currWeekDay = weekday(sDate)
    offsetWeekDay = 2 - currWeekDay
    firstWeekDate = DateAdd("d", offsetWeekDay,sDate)
    response.Write("<BR>" & weekday(sDate))
    endWeekDate = DateAdd("d", 6,firstWeekDate) 'month(firstWeekDate) & "/" & (day(firstWeekDate) + 6) & "/" & year(firstWeekDate)
    response.write "<br>"
    '******************************** By Farhat *************************************
    dim pk,firstday,lastday
    pk = "11/10/2011"
    week = (DatePart("ww",pk))

    firstday = dateadd("d",(-datepart("w",date())),pk)
    lastday = dateadd("d",(7-datepart("w",date())),pk)

    'response.write week
    'response.write "<br>"
    'response.Write firstday
    'response.write "<br>"
    'response.Write lastday

    '******************************** End *************************************
    %>
    <table border="1">
    <%
    for row=0 to 3
    firstRowDate = DateAdd("d", row,firstWeekDate)
    %>
    <tr>
    <% if row <> 3 then %>
    <td><%=firstRowDate%></td><td><%=DateAdd("d", 4,firstRowDate)%></td>
    <% else %>
    <td><%=firstRowDate%></td><td><table><tr><td><%=MonthView_ColumnHead(firstWeekDate,true,false)%> </td><td><%=MonthView_ColumnHead(DateAdd("m", 1,firstWeekDate),true,true)%></td></tr></table></td>
    <% end if %>
    </tr>
    <%
    next
    %>
    </table>
    </body>
    </html>


    <%
    function MonthView_RowHead(currDate, bShowWeekNum)
    'Note: WeekDayNames are short and placed in one top row i.e. Sat, Sun
    end function

    function MonthView_ColumnHead(currDate, bShowWeekNum,btranspose)
    'Note: WeekDayNames are full and placed in one column i.e. Satureday, Sunday
    dim sMDate, eMDate, printDate, cLimit, rLimit
    dim arrWeekDayName(), r, c, rH
    if (bShowWeekNum=null) then
    bShowWeekNum=false
    end if
    if (btranspose=null) then
    btranspose=false
    end if
    if (not bShowWeekNum) then
    cLimit = 6
    rLimit = 7
    redim arrWeekDayName(cLimit,rLimit)
    sMDate = DateAdd("d",-1*day(currDate)+1,CDate(currDate))
    eMDate = DateAdd("m",1,CDate(sMDate))
    eMDate = DateAdd("d",-1,CDate(eMDate))
    printDate = sMDate
    for c=1 to cLimit
    for r=1 to rLimit
    if month(sMDate) = month(printDate) then
    if c=1 then
    arrWeekDayName(c,r) = WeekDayName(r)
    else
    if r=weekday(printDate) then
    arrWeekDayName(c,r) = day(printDate)
    printDate = DateAdd("d",1,CDate(printDate))
    end if
    if c=ubound(arrWeekDayName,1) and cint(arrWeekDayName(cLimit,rLimit)) <> 0 and cint(arrWeekDayName(cLimit,rLimit)) < day(eMDate) then
    c = 1
    end if
    end if
    end if
    next
    next
    else
    'response.write(FormatDateTime(now(),vblongdate))
    cLimit = 6
    rLimit = 8
    redim arrWeekDayName(cLimit,rLimit)
    sMDate = DateAdd("d",-1*day(currDate)+1,CDate(currDate))
    eMDate = DateAdd("m",1,CDate(sMDate))
    eMDate = DateAdd("d",-1,CDate(eMDate))
    printDate = sMDate
    for c=1 to cLimit
    for r=1 to rLimit
    if month(sMDate) = month(printDate) then
    if c=1 and r>1 then
    arrWeekDayName(c,r) = "<b>" & WeekDayName(1,true,r-1) & "</b>"
    elseif r=1 and c>1 then
    arrWeekDayName(c,r) = "<b>|" & datepart("ww", printDate) & "|</b>"

    elseif r>1 and c>1 then
    if r-1=weekday(printDate) then





    arrWeekDayName(c,r) = day(printDate)

    printdate = DateAdd("d",1,CDate(printDate))
    'if c>1 and r>1 then
    'arrWeekDayName(c,r) = day(printDate)
    'printdate = DateAdd("d",1,CDate(printDate))
    'end if

    end if
    if c=ubound(arrWeekDayName,1) and cint(arrWeekDayName(cLimit,rLimit)) <> 0 and cint(arrWeekDayName(cLimit,rLimit)) < day(eMDate) then
    c = 1
    end if
    end if
    end if
    next
    next
    end if


    %>


    <table>
    <%
    if btranspose then
    tempc = rLimit
    rLimit = cLimit
    climit = tempc
    end if
    'if climit>1 and rlimit>1 then
    'response.Write(arrWeekDayName(climit,rlimit))
    'end if

    for r=1 to rLimit
    %>
    <tr>
    <%
    for c=1 to cLimit
    if btranspose then
    tempc = r
    tempr = c
    else
    tempc = c
    tempr = r

    end if
    'if tempc>1 and tempr>1 then
    'response.Write(arrWeekDayName(tempc,tempr))
    'end if
    %>




    <td><a href="maincopy1.asp" onclick="document.getElementById('first').value=document.getElementById('first').value"><%=arrWeekDayName(tempc,tempr)%></a></td>
    <%
    'if tempr>1 and tempc>1 then
    'response.Write(arrWeekDayName(tempc,tempr))
    'end if
    %>
    <%
    next
    %>
    </tr>
    <tr>

    </tr>

    <%
    next
    %>
    </table>
    <%
    end function
    %>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •