473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP and JavaScript problem

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>

Nov 13 '05 #1
0 1094

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
6
by: Alex Rast | last post by:
First of all, this is not a programming question. I'm a user, not programming in JavaScript. I'm not, however, a novice user or even a power user - I certainly know programming intimately as well...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.