[Gllug] Re: javascript question (Adrian McMenamin)

jon jon at bangoid.com
Fri Apr 19 09:21:23 UTC 2002


Hi Adrian

>Why does Mozilla trap expired credit cards - but Konqueror (and the Evil 
>Empire's browser) do not?
>
>if (parseInt(document.ticket_order.card_year.value, 10) ==  2){
>		    var right_now = new Date;
>		    if (right_now.getMonth() >= 	                    
>parseInt(document.ticket_order.card_month.value, 10)){
>		    alert("Sorry, your credit card appears to have expired. Please check 
>the expiry date.");
>		    return false;
>		    }
>		    }
>		    }

Is the entry field a text box or a select?
If it's a select you need to use selectedIndex e.g.

var cc_m = document.ticket_order.card_month;
if (right_now.getMonth() >= parseInt(cc_m.options[cc_m.selectedIndex].value)) ...

Jon Ramsey

bangoid
111 Stanmore Hill
Stanmore
Middlesex
HA7 3DZ

Tel: 020 8954 2900
Fax: 020 8954 8500

http://www.bangoid.com




-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list