ASP and Javascript problem

Discussion in 'Javascript' started by Kamyk, Oct 13, 2004.

  1. Kamyk

    Kamyk Guest

    Hello all!

    I have problem with code. Firstly I have created the VBScript code which
    count me the time and days which left to the end of working week. I work
    from 8:00 am till 4 pm.
    I would like to show this information on the screen by using "input form
    element" and using onload event which is refreshed after every 1 second.
    Unfortunately I don`t want
    to replace vbscript code on javascript code to do so. I want to have
    vbscirpt. Could you do me a favour and rebuild this code below to make it
    properly working.

    I would be very grateful if you could help me
    Regards
    and thanx for help
    Marcin from Poland
    ----------------------------------------------------------------------------
    -----------------------

    <HTML>
    <HEAD>

    <% @language=vbscript %>
    <%
    function funkcja_czas()
    dim roznica_koniec_dnia_pracy,roznica_koniec_tygodnia, roznica_czas_m,
    roznica_czas_h, roznica_czas_s, znacznik_dnia1,znacznik_dnia2,
    znacznik_dnia, czas

    roznica_koniec_tygodnia=(7-weekday(date,vbMonday))

    roznica_koniec_dnia_pracy=roznica_koniec_tygodnia-2
    roznica_czas_h=(DateDiff("h",Time,CDate("16:00:00"))-1)

    if Hour(Time)<16 then
    czas=Cdate(Cstr(Hour((Time+Cdate("01:00:00")))) & ":00:00")
    roznica_czas_m=(DateDiff("n",time,czas))
    czas=Cdate(Cstr(Hour(Time) & ":" & Minute(Time+Cdate("00:01:00")) & ":00"))
    roznica_czas_s=(DateDiff("s",time,czas))
    if roznica_czas_s=60 then
    roznica_czas_s=0
    end if
    else
    roznica_czas_m=0
    end if


    if roznica_koniec_dnia_pracy=1 then
    znacznik_dnia1="dzieƱ"
    else
    znacznik_dnia1="dni"
    end if

    if roznica_koniec_tygodnia=2 then
    znacznik_dnia2="dzieƱ"
    else
    znacznik_dnia2="dni"
    end if

    funkcja_czas= ("Koniec tygodnia nastapi za " & roznica_koniec_tygodnia & " "
    & znacznik_dnia2 & "<BR>" & "Koniec tygodnia pracy nastapi za " &
    roznica_koniec_dnia_pracy &" "& znacznik_dnia1 & " " & roznica_czas_h & ":"
    & roznica_czas_m & ":" & roznica_czas_s & " sec.")
    end function
    ff="1"
    %>



    <SCRIPT LANGUAGE="JavaScript">
    <!--

    function clock()
    {

    document.clock.time.value=
    <%
    ff
    %>;
    window.setTimeout("clock()", 900);
    }

    // -->
    </SCRIPT>

    </HEAD>

    <BODY onload="clock();">

    <form name="clock">
    Time <input type=text name="time" size="20" style="border: 0">
    </form>
     
    Kamyk, Oct 13, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Virgil Hobbs
    Replies:
    0
    Views:
    523
    David Virgil Hobbs
    Jan 6, 2004
  2. tao lin
    Replies:
    2
    Views:
    4,902
    tao lin
    Jan 2, 2005
  3. Kamyk

    ASP and Javascript problem

    Kamyk, Oct 13, 2004, in forum: HTML
    Replies:
    2
    Views:
    485
  4. Andy
    Replies:
    2
    Views:
    230
    kaeli
    Mar 4, 2004
  5. porter

    Javascript and IE? Javascript and C#?

    porter, Oct 5, 2007, in forum: Javascript
    Replies:
    6
    Views:
    295
    Thomas 'PointedEars' Lahn
    Oct 6, 2007
Loading...

Share This Page