Author |
Topic |
@tomic
Senior Member
USA
1790 Posts |
Posted - 24 August 2002 : 16:34:30
|
*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
|
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? |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 24 August 2002 : 16:45:36
|
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 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 24 August 2002 : 18:01:01
|
elseif Request.QueryString("date") <> "" then
change this statement as below:
elseif Trim(Request.QueryString("date")) <> "" then
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 24 August 2002 : 18:39:33
|
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 |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 24 August 2002 : 18:55:29
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 24 August 2002 : 18:59:54
|
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? |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 24 August 2002 : 19:15:36
|
I have no idea what't up with this but I just tried to reproduce it and could not.
@tomic |
SportsBettingAcumen.com |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 24 August 2002 : 19:25:56
|
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. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 24 August 2002 : 19:39:30
|
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
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 August 2002 : 00:05:42
|
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 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 August 2002 : 00:17:28
|
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
|
|
|
corneillie
Junior Member
140 Posts |
Posted - 25 August 2002 : 14:29:27
|
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
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 25 August 2002 : 14:31:05
|
have you made the changes noted above? |
|
|
corneillie
Junior Member
140 Posts |
Posted - 25 August 2002 : 14:46:49
|
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! |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 25 August 2002 : 15:01:32
|
I e-mailed it to you. |
|
|
Topic |
|