Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My form didn't show the credit card numbers

    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" -->


    <head>
    <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.');
    document.donate.fullname.focus();
    return false;
    }

    if(v_address ==""){
    alert('Please enter your Address.');
    document.donate.Address.focus();
    return false;
    }
    if(v_city ==""){
    alert('Please enter your City.');
    document.donate.City.focus();
    return false;
    }
    if(v_province ==""){
    alert('Please enter your Province.');
    document.donate.Province.focus();
    return false;
    }
    if(v_postalcode ==""){
    alert('Please enter your Postal Code.');
    document.donate.PostalCode.focus();
    return false;
    }
    if(v_phone ==""){
    alert('Please enter your Phone Number.');
    document.donate.Phone.focus();
    return false;
    }
    if(v_email ==""){
    alert('Please enter your Email Address.');
    document.donate.email.focus();
    return false;
    }
    if(v_email!=v_cemail){
    alert('Your email addresses do not match. Please confirm your Email Address.');
    document.donate.confirm_email.focus();
    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.');
    document.donate.amount[0].focus();
    return false;

    }

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

    if(v_number ==""){
    alert('Please enter your Credit Card Number.');
    document.donate.elements[32].focus();
    return false;
    }
    if(v_date ==""){
    alert('Please enter your Credit Card Expiry Date.');
    document.donate.elements[33].focus();
    return false;
    }

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


    //stop hiding-->
    </script>
    <!-- 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" -->
    </head>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,314
    Thanks
    203
    Thanked 2,565 Times in 2,543 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •