View Full Version : My form didn't show the credit card numbers

01-09-2007, 11:04 PM
Hi Guys,

I am trying to debugging my donation form.
The problem that I am having is when people submit a credit card donation, an email form with all the person information is encrypted and emailed to us here to process. Somehow! the form make a mess.The last number digit in 4 credit card donations submitted is missing.

I have been trying debugging by my self for few hours but somehow, I didn't find any clue :(

My codes:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html><!-- InstanceBegin template="/Templates/master.dwt" codeOutsideHTMLIsLocked="false" -->

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>British C</title>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/js.js"></script>
<!-- InstanceBeginEditable name="head" -->
<script language=Javascript><!-- Hide this
function validate(donate)
var v_name=donate.fullname.value;
var v_address=donate.Address.value;
var v_city=donate.City.value;
var v_province=donate.Province.value;
var v_postalcode=donate.PostalCode.value;
var v_email=donate.email.value;
var v_cemail=donate.confirm_email.value;

var v_phone=donate.Phone.value;
var v_other=donate.donation_b.value;

var v_number=donate.elements[32].value;

var v_date=donate.elements[33].value;

var v_cardtype=donate.CreditCard.value;

if(v_name ==""){
alert('Please enter your Name.');
return false;

if(v_address ==""){
alert('Please enter your Address.');
return false;
if(v_city ==""){
alert('Please enter your City.');
return false;
if(v_province ==""){
alert('Please enter your Province.');
return false;
if(v_postalcode ==""){
alert('Please enter your Postal Code.');
return false;
if(v_phone ==""){
alert('Please enter your Phone Number.');
return false;
if(v_email ==""){
alert('Please enter your Email Address.');
return false;
alert('Your email addresses do not match. Please confirm your Email Address.');
return false;

if(donate.amount[0].checked == "" && donate.amount[1].checked == "" && donate.amount[2].checked == "" && donate.amount[3].checked == "" && donate.amount[4].checked == "" && donate.amount[5].checked == "" && donate.amount[6].checked == "" && v_other==""){
alert('Please enter a Donation Amount.');
return false;


if(donate.CreditCard[0].checked == "" && donate.CreditCard[1].checked == ""){
alert('Please enter your Credit Card Type.');
return false;

if(v_number ==""){
alert('Please enter your Credit Card Number.');
return false;
if(v_date ==""){
alert('Please enter your Credit Card Expiry Date.');
return false;

if(donate.YesNo[0].checked == "" && donate.YesNo[1].checked == ""){
alert('Please enter if you would like a Tax Receipt.');
return false;

//stop hiding-->
<!-- InstanceEndEditable -->
<!-- InstanceParam name="id_nav_1" type="text" value="link_lung" --><!-- InstanceParam name="id_nav_2" type="text" value="link_smoking" --><!-- InstanceParam name="id_nav_3" type="text" value="link_airquality" --><!-- InstanceParam name="id_nav_4" type="text" value="link_campaigns" --><!-- InstanceParam name="id_nav_5" type="text" value="link_association" --><!-- InstanceParam name="id_nav_6" type="text" value="link_media" --><!-- InstanceParam name="id_nav_7" type="text" value="link_donate_sel" -->

Philip M
01-10-2007, 08:43 AM
I don't see anything wrong - have a look at the HTML (is the field limited to 15 characters??)

But you need a lot more than this for credit card validation. It looks as though the user can enter any rubbish (even a single digit) and it is still accepted. And remember that the 3-digit security code is now mandatory.