473,625 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=vbscr ipt %>
<%
function funkcja_czas()
dim roznica_koniec_ dnia_pracy,rozn ica_koniec_tygo dnia, roznica_czas_m,
roznica_czas_h, roznica_czas_s, znacznik_dnia1, znacznik_dnia2,
znacznik_dnia, czas

roznica_koniec_ tygodnia=(7-weekday(date,vb Monday))

roznica_koniec_ dnia_pracy=rozn ica_koniec_tygo dnia-2
roznica_czas_h= (DateDiff("h",T ime,CDate("16:0 0:00"))-1)

if Hour(Time)<16 then
czas=Cdate(Cstr (Hour((Time+Cda te("01:00:00")) )) & ":00:00")
roznica_czas_m= (DateDiff("n",t ime,czas))
czas=Cdate(Cstr (Hour(Time) & ":" & Minute(Time+Cda te("00:01:00") ) & ":00"))
roznica_czas_s= (DateDiff("s",t ime,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="JavaS cript">
<!--

function clock()
{

document.clock. time.value=
<%
ff
%>;
window.setTimeo ut("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 1112

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

Similar topics

13
9425
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 intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
53
5688
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 difficult to know what is going on. One of these Order Forms you can see here... http://www.cardman.co.uk/orderform.php3
6
2268
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 as computer hardware, configuration, etc... down to the lowest level (e.g. BIOS, assembly language, etc). Anyway, I've obviously got something wrong with JavaScript configuration, files, etc. in Windows 2000, Service Pack 3, because on sites...
136
9296
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
0
8251
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.