K
Kermit Piper
Hello,
I am comparing two date values, one from a database and one that has
been converted from a hard-coded string into an actual Date type. So
far so good. The problem I'm having is that one of the values comes
from the database, and for existing values it works fine, but if the
date doesn't exist (which will always be the condition when the user
first enters into the form) I am adding logic to my javascript like: if
(dbDate < staticDate || dbDate == ""), then we go into our validation
code. But it isn't working for a new form entry, only if the record
already exists. I think the problem is that because I'm comparing
actual Date values, the (dbDate == "") isn't going to work because ""
is a string value if I'm not mistaken, and this won't work against a
Date value.
So, my question is, what is the best way to check for a non-existent
Date object (value). Should I do something like (dbDate == null)? I'm
just not exactly sure how to check for a non-existent date object. Any
advice would really be appreciated.
Thanks,
KP
I am comparing two date values, one from a database and one that has
been converted from a hard-coded string into an actual Date type. So
far so good. The problem I'm having is that one of the values comes
from the database, and for existing values it works fine, but if the
date doesn't exist (which will always be the condition when the user
first enters into the form) I am adding logic to my javascript like: if
(dbDate < staticDate || dbDate == ""), then we go into our validation
code. But it isn't working for a new form entry, only if the record
already exists. I think the problem is that because I'm comparing
actual Date values, the (dbDate == "") isn't going to work because ""
is a string value if I'm not mistaken, and this won't work against a
Date value.
So, my question is, what is the best way to check for a non-existent
Date object (value). Should I do something like (dbDate == null)? I'm
just not exactly sure how to check for a non-existent date object. Any
advice would really be appreciated.
Thanks,
KP