Results 1 to 2 of 2

Thread: Credit Card Expiry Date validation for Custom Validator

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    1

    Thumbs up Credit Card Expiry Date validation for Custom Validator

    Function validateexpirydate(sender,args) { var txtvalue=args.value; var i=txtvalue.indexof('/'); var dt=new date(); var dtyear=dt.getfullyear(); var dtmonth=dt.getmonth(); var stryear=dtyear+''; var strsubstring=stryear.substring(2,4);//current year=07 var strsubstring1=stryear.substring(0,2);//current year prefix=20 if(i==2)//checking '/' character { var yearpart=txtvalue.substring(i+1,5);//checking separatley year part with textbox value var monthpart=txtvalue.substring(0,2)-1;//checking separatley month part with textbox value var currentyear=strsubstring1+yearpart;//current year prefix + user entered year if(currentyear==dtyear) { if(monthpart>=0 && monthpart<=11) { if(monthpart>dtmonth) { args.isvalid=true; return true; } else { args.isvalid=false; return false; } } else { args.isvalid=false; return false; } } else if(currentyear>dtyear) { if(monthpart>=0 && monthpart<=11) { args.isvalid=true; return true; } else { args.isvalid=false; return false; } } else { args.isvalid=false; return false; } } else { args.isvalid=false; return false; } } html code -------------------- ** *


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: Credit Card Expiry Date validation for Custom Validator

    can you please edit your post to displaying clearly? I am not able to get clearly.

    There is an edit option in your post.

    -----------------------
    suresh


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact