Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 Pop_datepicker 3.4.01
 Forum Locked  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

@tomic
Senior Member

USA
1790 Posts

Posted - 24 August 2002 :  16:34:30  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
*sigh*

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: ""]'

/forum2/pop_datepicker.asp, line 166

@tomic

SportsBettingAcumen.com

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 24 August 2002 :  16:40:15  Show Profile
and the circumstances that led to you seeing this error were? We need more info than just a line # and an error. Had you already chose a date and then re-edited it? Was the Birth Date empty? Did you get this error when the popup first popped up?
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 24 August 2002 :  16:45:36  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Sorry, it was the first time trying to enter a birthdate via the pop.profile.asp page so there was no existing record. This error appeared as soon as the datepicker appeared.

@tomic

SportsBettingAcumen.com
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 24 August 2002 :  18:01:01  Show Profile
elseif Request.QueryString("date") <> "" then



change this statement as below:

elseif Trim(Request.QueryString("date")) <> "" then


Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 24 August 2002 :  18:39:33  Show Profile
I tried, but was unable to reproduce the error, without changing the code. Nevertheless, some validation can be entered to check

If the string is a numeric value,
If the string is 8 digits long,
First four digits(together) are a valid year,
5th and 6th digits(together) are a valid month and
7th and 8th digits(together) are a valid day

elseif Request.QueryString("date") <> "" then


Change the above statement on line 162 as below

elseif IsValidDate(Request.QueryString("date")) then


To do the validation add the following functions to pop_datepicker.asp

I need to do some trsting on the code posted so will post again after corrections:


Removed

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

Edited by - GauravBhabu on 24 August 2002 19:12:49
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 24 August 2002 :  18:55:29  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
As it turns out this problem only occurs if i am logged in as admin. When I make another profile it works fine.

@tomic

SportsBettingAcumen.com
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 24 August 2002 :  18:59:54  Show Profile
can you do a view source of the page before you click on the button to bring up the calendar to see what the value is for that field?
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 24 August 2002 :  19:15:36  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
I have no idea what't up with this but I just tried to reproduce it and could not.

@tomic

SportsBettingAcumen.com
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 24 August 2002 :  19:25:56  Show Profile
Anyway, it will be a good idea to have the validation, because there is a chance of that error occuring occassionally. When I was correcting the code, It did occur to me that this kind of error may happen. I cannot recall the scenario but I will try to do the tests and figure it out.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 24 August 2002 :  19:39:30  Show Profile
I had to modify the functions some, here is what I have that works:

function IsValidDate(strDOBDate)
IsValidDate = false
if IsNumeric(strDOBDate) then
if len(strDOBDate) = 8 then
if IsValidYear(Left(strDOBDate, 4)) then
if IsValidMonth(Mid(strDOBDate, 5, 2)) then
if IsValidDay(strDOBDate) then
IsValidDate = true
end if
end if
end if
end if
end if
end function
function IsValidYear(ByVal intYear)
IsValidYear = false
if (cLng(intYear) > 1900) and (cLng(intYear) < Year(Date)) then IsValidYear = true
end Function
function IsValidMonth(ByVal intMonth)
IsValidMonth = false
if cLng(intMonth) > 0 and cLng(intMonth) < 13 then IsValidMonth = true
end Function
function IsValidDay(ByVal strDOBDate)
dim arrDaysInMonth
arrDaysInMonth = Array(31,28,31,30,31,30,31,31,30,31,30,31)
IsValidDay = false
if IsLeapYear(cLng(Left(strDOBDate, 4))) then arrDaysInMonth(1) = 29
if cLng(Mid(strDOBDate,7,2)) <= arrDaysInMonth(cLng(Mid(strDOBDate,5,2))) then IsValidDay = true
end Function

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 25 August 2002 :  00:05:42  Show Profile
That is correct Richard, Thanks for making the corrections. The following is essentially the same, instead uses the local variables to hold the date parts. This will also validate the dates falling within the current year as valid dates

<EDIT>Correction See Text in Red (Last Statement)</EDIT>


function IsValidDate(strDOBDate)
dim intYear, intMonth, intDay
IsValidDate = false
if IsNumeric(strDOBDate) then
if len(strDOBDate) = 8 then
intYear = cLng(Left(strDOBDate, 4))
intMonth =clng(Mid(strDOBDate, 5, 2))
intDay = cLng(Mid(strDOBDate,7,2))
if IsValidYear(intYear) then
if IsValidMonth(intMonth) then
if IsValidDay(intYear,intMonth, intDay) then IsValidDate = true
end if
end if
end if
end if
end function
function IsValidYear(ByVal intYear)
IsValidYear = false
if (intYear > 1900) and (intYear <= Year(Date)) then IsValidYear = true
end Function
function IsValidMonth(ByVal intMonth)
IsValidMonth = false
if intMonth > 0 and intMonth < 13 then IsValidMonth = true
end Function
function IsValidDay(ByVal intYear, ByVal intMonth, ByVal intDay)
dim arrDaysInMonth
arrDaysInMonth = Array(31,28,31,30,31,30,31,31,30,31,30,31)
IsValidDay = false
if IsLeapYear(intYear) then arrDaysInMonth(1) = 29
if (intDay) <= arrDaysInMonth(intMonth-1) then IsValidDay = true
end Function

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

Edited by - GauravBhabu on 25 August 2002 20:23:24
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 25 August 2002 :  00:17:28  Show Profile
for int_YearCntr = (Year(strForumTimeAdjust) - 101) to Year(strForumTimeAdjust) step 1


Above (Line 212 in pop_datepicker.asp) need to be changed as below.

for int_YearCntr = 1901 to Year(strForumTimeAdjust) step 1



Go to Top of Page

corneillie
Junior Member

140 Posts

Posted - 25 August 2002 :  14:29:27  Show Profile  Visit corneillie's Homepage
I do have exactly the same problem with 3.4.01.
When I edit my profile and I click the birthday button, it shows the pop datepicker with the date on my birthday. When I wanna change my date, I click clear BOD and the pop closes. Then I want to give my birthday in and the error discribed above shows up.

Thanks
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 25 August 2002 :  14:31:05  Show Profile
have you made the changes noted above?
Go to Top of Page

corneillie
Junior Member

140 Posts

Posted - 25 August 2002 :  14:46:49  Show Profile  Visit corneillie's Homepage
Richard,

Would you please be so kind to mail me the pop datepicker because i've tried to do the changes but it messed up everything.

steven@corneillie.be

Thanks a lot!
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 25 August 2002 :  15:01:32  Show Profile
I e-mailed it to you.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07