Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old August 19th, 2002, 01:59 PM
Kim Kim is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Singapore
Posts: 1 Kim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
<br>
<table width="248" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<input type='Submit' value='Make Now' name='Submit' >
&nbsp;&nbsp;<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>&nbsp;</p>


</BODY>

Reply With Quote
  #2  
Old August 19th, 2002, 07:13 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Firstly read the Devarticles Forum Rules(08/17/02). You need to explain what is actually wrong!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > credit card validation help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway