View Single Post
  #23  
Old 06-18-2004, 05:25 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default Javascript help

OK, using the examples I have written about above, I've successfuly created dropdown boxes for the expiry and valid from dates using the smarty function, html_select_date. The problem I have now is when I switch CC validation on the Javascript cc checking function falls flat as it's checking the default $expire_date value. At the moment I'm getting two values that are eventually concatenated:

card_expire_Month e.g. 06
card_expire_Year e.g. 2004

I was trying to be clever in altering the cc validating javascript by changing function checkExpirationDate in check_cc_number_script.tpl by replacing:

Code:
ed = expiration_date.value;

with:

Code:
ed = card_expire_Month + card_expire_Year.substring(2,2);

to concatenate the month and the last two digits of the year from these Smarty select boxes. Now I get a javascript error saying "card_expire_Month" is undefined.

Any ideas on how to sort this before I remove the expiry date checking javascript altogether?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote