SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Date Automation
-
Oct 7, 2003, 06:42 #1
- Join Date
- Sep 2003
- Location
- Indonesia
- Posts
- 40
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Date Automation
hi i have a problem with age Updating, when i click the calendar the age textbox will autofill point to current date and it's working properly, but the problem when i test to change the Year on the System/Control Panel on my computer, the age not change automatically....i wondering how could it be......anyone can help...thxx
here's my code for calendar and age :
<script LANGUAGE="vbSCript">
sub window_onload()
end sub
Sub GetDate(objMe,x,y)
strThisElement = objMe.getattribute("IndexVal")
x= x & "px"
retVal = window.showModalDialog ("../../Calendar2/calDraw1.asp?Locale=Set""0","0","dialogWidth:248px;dialogHeight:208px;dialogleft:"& x &";dialogtop:"& y &";status: no;unadorned: yes;help: no;scroll:no")
If retVal <> "" Then
document.all(strThisElement).value = retVal
dateofbirth = document.frmQuery.DateOfBirth.value
age = round(datediff("m",dateofbirth,now)/12)
if datepart("m",dateofbirth) > datepart("m",now) then
document.frmQuery.Age.value = age - 1
else
document.frmQuery.Age.value = age
end if
End If
End Sub
</script>
-
Oct 9, 2003, 02:24 #2
- Join Date
- Jan 2002
- Location
- London
- Posts
- 3,509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is client-side VBScript, not server-side. Although it's not actually JavaScript, it's more likely to get an answer in that forum, since they both do exactly the same thing in the browser, using the same DOM/objects, just with a different syntax...
(I've issued a move request)MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!
-
Oct 11, 2003, 04:28 #3
- Join Date
- Jan 2002
- Location
- London
- Posts
- 3,509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by endrue
MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!
-
Oct 13, 2003, 23:05 #4
- Join Date
- Sep 2003
- Location
- Indonesia
- Posts
- 40
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, marco....that's what i want it...but how..anyway
-
Oct 14, 2003, 02:22 #5
- Join Date
- Jan 2002
- Location
- London
- Posts
- 3,509
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by endrue
You *want* the age to stay the same no matter what year your PC clock says? I thought that was the *problem*, and that you want it to *change* as one would expect!!
MarcusJT
- former ASP web developer / former SPF "ASP Guru"
- *very* old blog with some useful ASP code
- Please think, Google, and search these forums before posting!
-
Oct 14, 2003, 17:51 #6
- Join Date
- Sep 2003
- Location
- Indonesia
- Posts
- 40
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Sorry2, ok . I clear the problem i have. The Problem is, the Age Won't Change although i change the date time on the control panel. Then i Want it change automatically when maybe the user date time on the computer is not set for the current date...is that clear....
thx.....sorry make you confused....
Bookmarks