|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
credit card validation help
Can someone help me with credit card validation
here's the html <html> <head> <title></title> < <center> <title>Future Dates</title> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <script language="JavaScript" src="validation.js"></script> <script language="JavaScript"> function validateExpirationDate(dateString){ theDate = parseDate; } function validateForm(){ with (document.form1) { if (surname.value == '') { alert('Please enter your Surname.'); } else if (firstname.value == '') { alert('Please enter your firstname.'); } else if (day_phone.value == '') { alert('Please enter a phone number.'); } else if (email.value == '') { alert('Please enter your email address.'); } else if (!formCheckEmail(email.value)) { alert('Please enter a valid email address.'); } else if (Address1.value == '') { alert('Please enter your street address.'); } else if (city.value == '') { alert('Please enter your city you are in.'); } else if (country.value == '') { alert('Please enter the country you are in.'); } else if (postal.value == '') { alert('Please enter your postal code for your address.'); } else if (CreditCardNumber.value == '') { alert('Please enter your credit card number.'); } else if (!formCheckCC(CreditCardNumber.value, CreditCardType[CreditCardType.selectedIndex].value)) { alert('Please enter a valid credit card number.'); } else if (ExpDateMonth.selectedIndex == 0) { alert('Please enter your credit card number expiration date.'); } else if (ExpDateYear.selectedIndex == 0) { alert('Please enter your credit card number expiration date.'); } else if (ExpDateYear.selectedIndex == 0) { alert('Please enter your credit card number expiration date.'); return false; } else return true; } } // end hiding --> </script> <form action='make.php' method='post' name='form1' onSubmit="return validateForm(this);return false;"> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Sur Name:</font></td> <td width="379" bgcolor="#FFFFFF"> <input type="text" size="35" name="surname" value="" > </font> </td> </tr> <font face="Antigoni" size="2">*</font></td> <font face="Antigoni" size="2">First Name:</font <input type="text" size="35" name="firstname" value="" > </font> </td> </tr> <font face="Antigoni" size="2">Company:</font></td> <input type="text" size="35" maxlength="30" name="company" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">*</font></td> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Telephone:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" maxlength="14" name="day_phone" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"> </td> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Fax:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" maxlength="14" name="Fax" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">*</font></td> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Email:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" name="email" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">*</font></td> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Street:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" maxlength="30" name="Address1" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"> </td> <td width="165" align="right" bgcolor="#FFFFFF"> <p><font face="Antigoni" size="2">Street (continued):</font></p> </td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" maxlength="30" name="Address2" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">*</font></td> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">City:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" name="city" value="" > </font> </td> </tr> <tr bgcolor='#99CC99'> <td width="95" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">*</font></td> </font> <td width="165" align="right" bgcolor="#FFFFFF"><font face="Antigoni" size="2">Country:</font><font face='Arial' size='-1'><font face="Antigoni" size="2"></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" name="country" value="" > </font> </b></font> </td> </tr> <tr bgcolor="#F4F2F4"> <td width="95" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">*</font></td> <td width="165" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">Postal Code:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" name="postal" value="" > </font> </td> </tr> <tr bgcolor="#F4F2F4"> <td width="95" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">*</font></td> <td width="165" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">Credit Card Type:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <select size="1" name="CreditCardType" onChange="hasChanged = true;"> <option value="American Express" >American Express</option> <option value="Mastercard" >Mastercard</option> <option value="Visa" >Visa</option> </select> </font> </td> </tr> <tr bgcolor="#F4F2F4"> <td width="95" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">*</font></td> <td width="165" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">Credit Card Number:</font></td> <td width="379" bgcolor="#FFFFFF"> <font face="Antigoni" size="2"> <input type="text" size="35" name="CreditCardNumber" value="" onChange="hasChanged = true;"> </font> </td> </tr> <tr bgcolor="#F4F2F4"> <td width="95" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">*</font></td> <td width="165" bgcolor="#FFFFFF" align="right"><font face="Antigoni" size="2">Expiration Date:</font></td> <td width="379" bgcolor="#FFFFFF"> <font size="2"> <select name="ExpDateMonth" onChange="hasChanged = true;"> <option value="" selected>Month...</option> <option value="1" >January</option> <option value="2" >February</option> <option value="3" >March</option> <option value="4" >April</option> <option value="5" >May</option> <option value="6" >June</option> <option value="7" >July</option> <option value="8" >August</option> <option value="9" >September</option> <option value="10" >October</option> <option value="11" >November</option> <option value="12" >December</option> </select> <select name="ExpDateYear" onChange="hasChanged = true;"> <option value="" selected>Year...</option> <option value="2001" >2001</option> <option value="2002" >2002</option> <option value="2003" >2003</option> <option value="2004" >2004</option> <option value="2005" >2005</option> <option value="2006" >2006</option> <option value="2007" >2007</option> <option value="2008" >2008</option> <option value="2009" >2009</option> <option value="2010" >2010</option> </select> </font> </td> </tr> </table> <table> <td width="4" align="center" valign="top"> </td> <br> <table width="248" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <input type='Submit' value='Make Now' name='Submit' > <input type='reset' value='Clear Form' name='reset'> </td> </tr> </table> </form> </form> <p> <font face='Antigoni Med' size='-1'>Do not click twice on the "Confirmation Button"</font><!--footer--> <p><br> </center> </tr> </TABLE> </center> <p> </p> </BODY> |
|
#2
|
|||
|
|||
|
Firstly read the Devarticles Forum Rules(08/17/02). You need to explain what is actually wrong!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > credit card validation help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|