Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expiry date validation

Status
Not open for further replies.

tuam1234

Technical User
Feb 6, 2004
52
IE
does anybody have code or know where i could get code that would help me to validate the expiry date on a credit card form??

i appreciate any help!!!
 
validate it for what?

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
 
thanks for replying...

il explain what i wan ta bit better. i have a credit card details form and i need code that will show an error mge if the user enters an invalid expiry date, eg 02 2004 (invalid), 04 2004 (valid)!!
 
In other words, if the month/year of a credit card is less than the current month/year, then false, else true? Here's a simple example that you can modify as needed (if this is indeed what you are trying to do):
Code:
if ExpireYr < Year(Now()) then
  'Card is expired, do something here
elseif ExpireYr >= Year(Now()) and ExpireMth < Month(Now()) then
  'Card is expired, do something here
else
  'Card is ok and not expired, do something here
end if

-----------------------------------------------------------------------------------------------------
&quot;If you can't explain something to a six-year-old, you really don't understand it yourself.&quot;
-- Albert Einstein
 
thanks for that chopstik :> il check it out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top