[Javascript] Credit card page, processing before it's ready

coldfusion.developer at att.net coldfusion.developer at att.net
Tue Aug 31 09:49:17 CDT 2004


Hi,

I have this Javascript that checks the details of credit card submissions.  It does the alert when the error is present, but after I click ok and try to go and fix the error, the page processes to the submission page.  I need it to stop and allow the user to fix the error before processing the page.

Search for the string document.ThisForm.submit(); which is processing the form at the wrong time.

Ahhh!

<!--  C R E D I T   C A R D   V A L I D T I O N  -->

<!-- TWO STEPS TO INSTALL CREDIT CARD VALIDATION:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var Cards = new makeArray(8);
Cards[0] = new CardType("MasterCard", "51,52,53,54,55", "16");
var MasterCard = Cards[0];
Cards[1] = new CardType("VisaCard", "4", "13,16");
var VisaCard = Cards[1];
Cards[2] = new CardType("AmExCard", "34,37", "15");
var AmExCard = Cards[2];
Cards[3] = new CardType("DinersClubCard", "30,36,38", "14");
var DinersClubCard = Cards[3];
Cards[4] = new CardType("DiscoverCard", "6011", "16");
var DiscoverCard = Cards[4];
Cards[5] = new CardType("enRouteCard", "2014,2149", "15");
var enRouteCard = Cards[5];
Cards[6] = new CardType("JCBCard", "3088,3096,3112,3158,3337,3528", "16");
var JCBCard = Cards[6];
var LuhnCheckSum = Cards[7] = new CardType();

/*************************************************************************\
CheckCardNumber(form)
function called when users click the "check" button.
\*************************************************************************/
function CheckCardNumber(form) {
var tmpyear;
if (form.CardNumber.value.length == 0) {
alert("Please enter a Card Number.");
form.CardNumber.focus();
return;
}
if (form.ExpYear.value.length == 0) {
alert("Please enter the Expiration Year.");
form.ExpYear.focus();
return;
}
if (form.ExpYear.value > 96)
tmpyear = "19" + form.ExpYear.value;
else if (form.ExpYear.value < 21)
tmpyear = "20" + form.ExpYear.value;
else {
alert("The Expiration Year is not valid.");
return;
}
tmpmonth = form.ExpMon.options[form.ExpMon.selectedIndex].value;
// The following line doesn't work in IE3, you need to change it
// to something like "(new CardType())...".
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
alert("This card has already expired.");
return;
}
card = form.CardType.options[form.CardType.selectedIndex].value;
var retval = eval(card + ".checkCardNumber(\"" + form.CardNumber.value +
"\", " + tmpyear + ", " + tmpmonth + ");");
cardname = "";
if (retval)
document.ThisForm.submit();


// comment this out if used on an order form
// alert("This card number appears to be valid.");


else {
// The cardnumber has the valid luhn checksum, but we want to know which
// cardtype it belongs to.
for (var n = 0; n < Cards.size; n++) {
if (Cards[n].checkCardNumber(form.CardNumber.value, tmpyear, tmpmonth)) {
cardname = Cards[n].getCardType();
break;
   }
}
if (cardname.length > 0) {
alert("This looks like a " + cardname + " number, not a " + card + " number.");
}
else {
alert("This card number is not valid.");
      }
   }
}
/*************************************************************************\
Object CardType([String cardtype, String rules, String len, int year, 
                                        int month])
cardtype    : type of card, eg: MasterCard, Visa, etc.
rules       : rules of the cardnumber, eg: "4", "6011", "34,37".
len         : valid length of cardnumber, eg: "16,19", "13,16".
year        : year of expiry date.
month       : month of expiry date.
eg:
var VisaCard = new CardType("Visa", "4", "16");
var AmExCard = new CardType("AmEx", "34,37", "15");
\*************************************************************************/
function CardType() {
var n;
var argv = CardType.arguments;
var argc = CardType.arguments.length;

this.objname = "object CardType";

var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";

this.setCardNumber = setCardNumber;  // set CardNumber method.
this.setCardType = setCardType;  // setCardType method.
this.setLen = setLen;  // setLen method.
this.setRules = setRules;  // setRules method.
this.setExpiryDate = setExpiryDate;  // setExpiryDate method.

this.setCardType(tmpcardtype);
this.setLen(tmplen);
this.setRules(tmprules);
if (argc > 4)
this.setExpiryDate(argv[3], argv[4]);

this.checkCardNumber = checkCardNumber;  // checkCardNumber method.
this.getExpiryDate = getExpiryDate;  // getExpiryDate method.
this.getCardType = getCardType;  // getCardType method.
this.isCardNumber = isCardNumber;  // isCardNumber method.
this.isExpiryDate = isExpiryDate;  // isExpiryDate method.
this.luhnCheck = luhnCheck;// luhnCheck method.
return this;
}

/*************************************************************************\
boolean checkCardNumber([String cardnumber, int year, int month])
return true if cardnumber pass the luhncheck and the expiry date is
valid, else return false.
\*************************************************************************/
function checkCardNumber() {
var argv = checkCardNumber.arguments;
var argc = checkCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
var year = (argc > 1) ? argv[1] : this.year;
var month = (argc > 2) ? argv[2] : this.month;

this.setCardNumber(cardnumber);
this.setExpiryDate(year, month);

if (!this.isCardNumber())
return false;
if (!this.isExpiryDate())
return false;

return true;
}
/*************************************************************************\
String getCardType()
return the cardtype.
\*************************************************************************/
function getCardType() {
return this.cardtype;
}
/*************************************************************************\
String getExpiryDate()
return the expiry date.
\*************************************************************************/
function getExpiryDate() {
return this.month + "/" + this.year;
}
/*************************************************************************\
boolean isCardNumber([String cardnumber])
return true if cardnumber pass the luhncheck and the rules, else return
false.
\*************************************************************************/
function isCardNumber() {
var argv = isCardNumber.arguments;
var argc = isCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
if (!this.luhnCheck())
return false;

for (var n = 0; n < this.len.size; n++)
if (cardnumber.toString().length == this.len[n]) {
for (var m = 0; m < this.rules.size; m++) {
var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
if (headdigit == this.rules[m])
return true;
}
return false;
}
return false;
}

/*************************************************************************\
boolean isExpiryDate([int year, int month])
return true if the date is a valid expiry date,
else return false.
\*************************************************************************/
function isExpiryDate() {
var argv = isExpiryDate.arguments;
var argc = isExpiryDate.arguments.length;

year = argc > 0 ? argv[0] : this.year;
month = argc > 1 ? argv[1] : this.month;

if (!isNum(year+""))
return false;
if (!isNum(month+""))
return false;
today = new Date();
expiry = new Date(year, month);
if (today.getTime() > expiry.getTime())
return false;
else
return true;
}

/*************************************************************************\
boolean isNum(String argvalue)
return true if argvalue contains only numeric characters,
else return false.
\*************************************************************************/
function isNum(argvalue) {
argvalue = argvalue.toString();

if (argvalue.length == 0)
return false;

for (var n = 0; n < argvalue.length; n++)
if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
return false;

return true;
}

/*************************************************************************\
boolean luhnCheck([String CardNumber])
return true if CardNumber pass the luhn check else return false.
Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
\*************************************************************************/
function luhnCheck() {
var argv = luhnCheck.arguments;
var argc = luhnCheck.arguments.length;

var CardNumber = argc > 0 ? argv[0] : this.cardnumber;

if (! isNum(CardNumber)) {
return false;
  }

var no_digit = CardNumber.length;
var oddoeven = no_digit & 1;
var sum = 0;

for (var count = 0; count < no_digit; count++) {
var digit = parseInt(CardNumber.charAt(count));
if (!((count & 1) ^ oddoeven)) {
digit *= 2;
if (digit > 9)
digit -= 9;
}
sum += digit;
}
if (sum % 10 == 0)
return true;
else
return false;
}

/*************************************************************************\
ArrayObject makeArray(int size)
return the array object in the size specified.
\*************************************************************************/
function makeArray(size) {
this.size = size;
return this;
}

/*************************************************************************\
CardType setCardNumber(cardnumber)
return the CardType object.
\*************************************************************************/
function setCardNumber(cardnumber) {
this.cardnumber = cardnumber;
return this;
}

/*************************************************************************\
CardType setCardType(cardtype)
return the CardType object.
\*************************************************************************/
function setCardType(cardtype) {
this.cardtype = cardtype;
return this;
}

/*************************************************************************\
CardType setExpiryDate(year, month)
return the CardType object.
\*************************************************************************/
function setExpiryDate(year, month) {
this.year = year;
this.month = month;
return this;
}

/*************************************************************************\
CardType setLen(len)
return the CardType object.
\*************************************************************************/
function setLen(len) {
// Create the len array.
if (len.length == 0 || len == null)
len = "13,14,15,16,19";

var tmplen = len;
n = 1;
while (tmplen.indexOf(",") != -1) {
tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
n++;
}
this.len = new makeArray(n);
n = 0;
while (len.indexOf(",") != -1) {
var tmpstr = len.substring(0, len.indexOf(","));
this.len[n] = tmpstr;
len = len.substring(len.indexOf(",") + 1, len.length);
n++;
}
this.len[n] = len;
return this;
}

/*************************************************************************\
CardType setRules()
return the CardType object.
\*************************************************************************/
function setRules(rules) {
// Create the rules array.
if (rules.length == 0 || rules == null)
rules = "0,1,2,3,4,5,6,7,8,9";
  
var tmprules = rules;
n = 1;
while (tmprules.indexOf(",") != -1) {
tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
n++;
}
this.rules = new makeArray(n);
n = 0;
while (rules.indexOf(",") != -1) {
var tmpstr = rules.substring(0, rules.indexOf(","));
this.rules[n] = tmpstr;
rules = rules.substring(rules.indexOf(",") + 1, rules.length);
n++;
}
this.rules[n] = rules;
return this;
}
{

}

//  End -->
</script>


 <!--- Get Customer Info --->
 <cfquery name="qryGetuserInfo" datasource="rttpdata">
 	SELECT *
	FROM custinfo
	WHERE userID = '#userID#'
 </cfquery>
 
 <!--- Create Flag for User Info  --->
	<cfif qryGetuserInfo.recordcount eq 1>
	<cfset userInfo="y">
	<cfelse>
	<cfset userInfo = "n">
	</cfif>
	
<!--- This Section Selects Tax Rate and for taxable orders --->
<cfset ccBill = "yes">
<cfif parameterexists(taxcode) is "yes" AND taxcode eq 1>
 	<cfquery name="qryTaxTable" datasource="rttpdata">
		SELECT *
		FROM rttpZipCounty
		WHERE id = #taxcity#
	</cfquery>
	<cfset cityTax='#qryTaxTable.city#'>
	<cfset taxState='#qryTaxTable.state#'>
	<cfset taxZip = '#qryTaxTable.zip#'>
	<cfset taxrate = #qryTaxTable.combinedSalesTax#>	
	<cfset zipCounty = #qryTaxTable.county#>
	
 </cfif>
 
 	<!--- This is a hack until we fix the daily deal to make it monthly deal! --->
		<cfscript>
		m = DatePart('m', now());
		y = DatePart('yyyy', now());
		d = 01;
		daysdate2 = dateformat(CreateDate(y, m, d), 'MM/DD/YYYY');
		</cfscript>
		
 <cfset daysdate = #dateformat(now(),'MM/DD/YYYY')#>
<cfquery name="qryGetDeal" datasource="rttpdata">
	SELECT *
	FROM daydeal
	WHERE dealdate = '#daysdate2#' 
</cfquery>

<cfquery name="qryckCart" datasource="rttpdata">
		SELECT *
		FROM shopcart
		WHERE userID = '#userID#' AND shipdate IS NULL
		</cfquery>
<!--- "#ListContains(promoList, partno)#"	 --->
<cfset promoList = "MECRT-05-008,MECRT-05-010,MECRT-05-011,MECRT-05-009">


<cfoutput query="qryckCart">
	<cfif partno neq "#qryGetDeal.partno#" and NOT "#ListContains(promoList, qryckCart.partno)#" >
		<cfquery name="qryGetinv" datasource="rttpdata">
			SELECT price
			FROM rttpinv
			Where partno = '#partno#'
		</cfquery>
		<!--- This updates the partno and shows it based on the invoice price... --->
		<cfquery name="qryUpShopPrice" datasource="rttpdata">
			UPDATE shopcart
			SET cost = #qryGetinv.price#
			WHERE partno = '#partno#'		
		</cfquery>
<cfelseif "#ListContains(promoList, qryckCart.partno)#">

<cfelse>
	<cfquery name="qryUpShopPrice" datasource="rttpdata">
			UPDATE shopcart
			SET cost = #qryGetDeal.dealprice#
			WHERE partno = '#partno#'				
		</cfquery>
		
	</cfif>

</cfoutput>

<cfif parameterexists(url.do) is "no">
		<cfquery name="qryckCart" datasource="rttpdata">
		SELECT *
		FROM shopcart
		WHERE userID = '#userID#' 
		</cfquery>
		
		<cfquery name="getCart" datasource="rttpdata">
		SELECT shopcart.cartID, shopcart.userID, shopcart.partno, shopcart.ordqty,shopcart.cost, shopcart.orderDate, shopcart.shipDate, shopcart.OrderNumber, rttpInv.shortdesc, rttpInv.price
		FROM shopcart INNER JOIN rttpInv ON shopcart.partno = rttpInv.partno
		WHERE (((shopcart.userID)='#userID#') AND ((shopcart.OrderNumber) Is Null))
		</cfquery>

		
<cfelse>
	<cfif url.do is "DEL">
		<cfquery name="qryDelCartItem" datasource="rttpdata">
		DELETE
		FROM shopcart
		WHERE userID = '#userID#' AND partno='#partno#'
		</cfquery>
		
		<cfquery name="getCart" datasource="rttpdata">
		SELECT shopcart.cartID,shopcart.Ordernumber, shopcart.userID, shopcart.partno, shopcart.ordqty,shopcart.cost, shopcart.orderDate, shopcart.shipDate, rttpInv.shortdesc, rttpInv.price
		FROM shopcart INNER JOIN rttpInv ON shopcart.partno = rttpInv.partno
		WHERE (((shopcart.userID)='#userID#') AND ((shopcart.OrderNumber) Is Null))
		</cfquery>
		<cfif isDefined("session.promoapplied")>
		<cfquery name="qryDelCartItem" datasource="rttpdata">
			DELETE
			FROM SpecPromos
			WHERE userID = '#userID#' AND  SpecPromoItem ='#partno#'
			</cfquery>
		</cfif>
		
</cfif>

		<cfif url.do is "adj">
		
			<cfif ordqty eq 0 >
			<cfquery name="qryDelItem" datasource="rttpdata">
			DELETE
			From shopcart
			WHERE userID = '#userID#' AND partno='#partno#'		
			</cfquery>
			<cfelse>
			<cfquery name="qryAdjQty" datasource="rttpdata">
			UPDATE shopcart
			SET ordqty = #ordqty#
			WHERE userID = '#userID#' AND partno='#partno#'		
			</cfquery>
			
			<cfquery name="getCart" datasource="rttpdata">
				SELECT shopcart.cartID,shopcart.Ordernumber, shopcart.userID, shopcart.partno, shopcart.ordqty, shopcart.cost,shopcart.orderDate, shopcart.shipDate, rttpInv.shortdesc, rttpInv.price
				FROM shopcart INNER JOIN rttpInv ON shopcart.partno = rttpInv.partno
				WHERE (((shopcart.userID)='#userID#') AND ((shopcart.OrderNumber) Is Null))
			</cfquery>
		</cfif>
	   </cfif>
	
<cfif url.do is "view">
	<cfquery name="getCart" datasource="rttpdata">
		SELECT shopcart.cartID,shopcart.Ordernumber, shopcart.userID, shopcart.partno, shopcart.ordqty, shopcart.cost,shopcart.orderDate, shopcart.shipDate, rttpInv.shortdesc, rttpInv.price
		FROM shopcart INNER JOIN rttpInv ON shopcart.partno = rttpInv.partno
		WHERE (((shopcart.userID)='#userID#') AND ((shopcart.OrderNumber) Is Null))
	</cfquery>
</cfif>
<cfif getCart.recordcount eq 0>
<p align="center">&nbsp;</p>
	<h3 align="center" class="HEarnie"><a href="http://www.rotundatechtools.com/default.cfm">[There is nothing in your cart]</a></h3>

<cfexit>
</cfif>

</cfif>

<cfif isDefined("pncode")>

<cfquery name="PnInfo" datasource="rttpdata">
	Select *
			From rttppalist
			WHERE pn = '#pncode#'
</cfquery>

<cfset pncode = #pncode#>
<cfset pndealer = '#PnInfo.dealer#'>
<cfset pnaddress=#PnInfo.physicalAddress#>
<cfset pncity = #PnInfo.physicalcity#>
<cfset pnstate = #PnInfo.physicalstate#>
<cfset pnzip = #PnInfo.physicalzip#>
<cfset pnphone = #PnInfo.phone#>

<cfset ccBill = "no">

</cfif>

 <cfif parameterexists(useGCs) is "yes">
 <cfset useGCs = #useGCs#>
</cfif>
<!--- Start Center of Page Here --->



<table width="100%" border="0">


<tr valign="top">
<td class="HErnie"><h3 align="center">Check-Out Page</h3>
</td></tr>


<tr>

<td >
	<table width="100%" bordercolordark="006699" border="1" class="PRODUCTLIST"  bordercolorlight="006699">
	<tr bgcolor="006699" class="PRODUCTHEAD" style="color: white;">
		<th>&nbsp;</th>
		<th>Item</th>
		<th>Description</th>
		<th>Quantity</th>
		<th>Cost</th>
		<th>Line Total</th>
	
	</tr>
	<cfset extprice =0>
			<cfset totprice = 0>
	<cfoutput query="getCart">
	
		<tr>
		<td>
		<form action="https://www.rotundatechtools.com/checkout2.cfm?do=del&partno=#partno#" method="post">
		<input type="Hidden" value="#partno#">
		
		<cfif parameterexists(useGCs) is "yes">
			<input type="Hidden" name="useGCs" value="yes">
		</cfif>
		
		<cfif parameterexists(taxcode)is "yes" AND taxcode eq 1>
		<input type="Hidden" name="taxcode" value="#taxcode#">
		<input type="Hidden" name="taxcity" value="#taxcity#">
		</cfif>
		<cfif parameterexists(pncode) is "yes">
		<input type="Hidden" name="pncode" value="#pncode#">
		</cfif>
		
		<input type="Submit"  value="Del">
		</form>
		
		</td>
		<td>#partno#</td>
		<td>#shortdesc#</td>
		<td align="center">
		<cfif isDefined("session.promoapplied") and cost EQ  0>
				#ordqty#
				<cfelse>
		<form  name="qtyChange" action="https://www.rotundatechtools.com/checkout2.cfm?do=adj"  method="post"> 
		<input type="Hidden" name="ordqty_required" value="Quantity is required!">
		<input type="Hidden" name="ordqty_integer" value="Quantity must be a number!">
		<input type="Text" size="2" name="ordqty" value="#ordqty#">
		<input type="Hidden" name="partno" value="#partno#">
		
		<cfif parameterexists(useGCs) is "yes">
			<input type="Hidden" name="useGCs" value="yes">
		</cfif>
						
		<cfif parameterexists(taxcode)is "yes" AND taxcode eq 1>
		<input type="Hidden" name="taxcode" value="#taxcode#">
		<input type="Hidden" name="taxcity" value="#taxcity#">
		</cfif>
		
		<cfif parameterexists(pncode) is "yes">
		<input type="Hidden" name="pncode" value="#pncode#">
		</cfif>
		
		<input type="Submit"  value="Edit">
		</form> 
		</cfif>
		</td>
		<cfif parameterexists(cost) is "no">
			<cfset cost = 0>
		</cfif>
		<td align="right">#dollarformat(cost)#</td>
		<td align="right"><cfset extprice = #cost#*#ordqty#>
			<cfset totprice = #totprice# + #extprice#>
		#dollarformat(extprice)#</td>

	</tr>
	<!--- Check for minimum Order --->

</cfoutput>

<cfoutput>

 <cfquery name="ckForUse" datasource="rttpdata">
	SELECT *
	FROM SpecPromos
	WHERE userID = '#userID#' AND usedThisSession =1
</cfquery>
<!--- This is here for the promo please don't comment this out -- See Dale 
<cfif parameterexists(ckForUse.recordcount) is "yes" and ckForUse.recordcount eq 1>
<tr>
<td>&nbsp;</td>
<td>#ckForUse.SpecPromoItem#</td>
<td>FREE PTS PROMO GLOVE</td>
<td align="center">1</td>
<td align="right">$0.00</td>
<td align="right">$0.00</td>
		
</tr>
</cfif> --->


<tr class="PRODUCTHEAD" bgcolor="006699">
<th colspan="5" align="right" style="color:white;">Item Total</th>
<th style="color:white;" align="right">#dollarformat(totprice)#</th></tr>

<cfif totprice lt 25 AND totprice gt 0 AND ckForUse.recordCount neq 1>
<tr><td colspan="6"><p align="center">$25.00 Order Minimum Required</p></td></tr>
<cfexit>
<cfelseif totprice lt 25 AND totprice gt 0 AND ckForUse.recordCount eq 1 AND getCart.recordCount gte 1>
<tr><td colspan="6"><p align="center">$25.00 Order Minimum Required</p></td></tr>
<cfexit>
<cfelseif totprice eq 0 AND ckForUse.recordCount neq 1>
<tr><td colspan="6"><p align="center">You have Nothing in your Cart</p></td></tr>
<cfexit>
</cfif>

<cfif not isDefined("pncode")>
 
<tr class="PRODUCTHEAD" bgcolor="006699">
<th colspan="5" align="right" style="color:white;">Sales Tax</th>

<th style="color:white;" align="right">
<cfif parameterexists(taxcode)is "No" OR taxcode neq 1>
#dollarformat(0)#
<cfset salestax = 0>
<cfelseif parameterexists(taxcode)is "yes" AND taxcode eq 1>
<cfset salesTax = #totPrice# * #taxRate#>
#dollarformat(salesTax)#
</cfif></th></tr>
<cfset totprice = #totprice# + #salestax#>
<tr class="PRODUCTHEAD" bgcolor="006699">
<th colspan="5" align="right" style="color:white;">Order Total</th>

<th style="color:white;" align="right">#dollarformat(totprice)#</th>
</tr>
</cfif>
<cfif parameterexists(pncode) is "no" AND parameterexists(useGCs) is "YES">
<cfquery name="getcertlist" datasource="rttpdata">
			SELECT *
			FROM RttpCouponworking
			WHERE userID = '#userID#'
		</cfquery>
		
<cfset coupTotal =0>
<cfset ordBal = #totprice#>
<cfloop query="getcertList">
			<cfset thiscoup = #avail#>
			<cfif ordbal lte thiscoup>
				<cfset thiscoup = #ordbal#>
			</cfif>
			<cfset ordbal = #ordbal#-#thiscoup#>
			<tr class="PRODUCTHEAD">
			<th bgcolor="006699" colspan="5" align="right" style="color:white;">Amount Applied from Gift Certificate #couponnumber# </th>
			
			
			<th bgcolor="006699" style="color:white;" align="right">#dollarformat(thiscoup)#</th>
			
				<cfquery name="applycoup" datasource="rttpdata">
					UPDATE RttpCouponWorking
					SET apply = #thiscoup#
					WHERE couponnumber = '#couponnumber#'
					</cfquery>
			</tr>
			
</cfloop>
<cfset totprice = #ordBal#>
</cfif>

<tr class="PRODUCTHEAD" bgcolor="006699">
<th colspan="5" align="right" style="color:white;">Amount Due</th>
		
<th style="color:white;" align="right">#dollarformat(totprice)#</th></tr>

</table>
</td></tr>
<tr><td>
<table width="100%">
<form name="ThisForm" action="https://www.rotundatechtools.com/orderconfirm.cfm" method="post" onsubmit="return checkit()">
		<cfif parameterexists(useGCs) is "yes">
				<input type="Hidden" name="useGCs" value="yes">
		</cfif>
			<cfif parameterexists(salestax) is "no"><cfset salestax =0>
			<input type="Hidden" name="salestax" value="#salesTax#">
		</cfif>
		
		<tr>
			<td valign="top" bgcolor="65C5CF" >
			<!--- Changes start here.... --->
			<cfif IsDefined("pncode")>
							<table class="PRODUCTLIST" cellpadding="3" cellspacing="0">
					<tr>
						<tH colspan="2" align="center" valign="top">
						<p align="center">Billing Information</p>
						</tH>
						
					</tr>
					
					<tr>
						<td valign="bottom" align="left">
						<input type="Hidden" name="fname" value="#pndealer#">
						<input type="Hidden" name="Lname" value=" ">
						<input type="Hidden" name="mni" value="">
						Dealer Name:
						<br>
						<input type="text" name="DealerName" value="#pndealer#" size="35" disabled>
						<!--- <input type="Text" size="15" name="fname"<cfif parameterexists(qryGetuserInfo.fname)is "yes">value="#qryGetuserInfo.fname#"</cfif> disabled> ---></td>
						<td valign="bottom" align="left" ><!--- value="#qryGetuserInfo.fname#"</cfif>><br>Middle Inital: --->
						<br><!--- <input type="Text" size="1" name="mni" maxlength="1" <cfif parameterexists(qryGetuserInfo.mni)is "yes">value="#qryGetuserInfo.mni#"</cfif>> ---></td>
					</tr>
					<!--- <tr>
						<td>Last Name:<br>
						<input type="Text" size="18" name="lname" <cfif parameterexists(qryGetuserInfo.lname)is "yes">value="#qryGetuserInfo.lname#"</cfif>></td>
						<td>&nbsp;</td>
					</tr> --->
					<tr>
					<td colspan="2">Address1:<br>
					<input type="text" name="billadd1" value="#pnaddress#" size="18" disabled>
					<input type="hidden" name="billadd1" value="#pnaddress#">
					<input type="hidden" name="billadd2" value=" ">
					</td>
					</tr>
					<!--- 
					<tr>
					<td colspan="2">Address2:<br>
						<input type="Text" size="18" name="billadd2" <cfif parameterexists(qryGetuserInfo.billadd2)is "yes">value="#qryGetuserInfo.billadd2#"</cfif>></td>
					</tr> 
					--->
					
					<tr>
					<td colspan="2">City:<br>
						<input type="Text" size="18" name="billcity" value="#pncity#" disabled>
						<input type="hidden" name="billcity" value="#pncity#">
						</td>
					</tr>
					
					<tr>
					<td>State:<br>
					<input type="text" name="billstate" value="#pnstate#" size="2" disabled>
					<input type="hidden" name="billstate" value="#pnstate#">
					</td>
					<td>
					Zip: <input type="Text" size="6" name="billzip" value="#pnzip#" disabled>
					<input type="hidden" name="billzip" value="#pnzip#">
					</td>
					</tr>
				<!--- <tr class="PRODUCTLIST">
				<td colspan="2">
				Email Address: <input type="Text" name="emailadd" <cfif parameterexists(qryGetuserInfo.emailadd)is "yes"> value="#qryGetuserInfo.emailadd#" </cfif>>
								<br><strong>Email used for Order Shipping &amp; Confirmation Notification.</strong>
				</td></tr> --->
				</td></tr>
				<tr class="PRODUCTLIST">
				<td colspan="2">Billing Phone: (Required) 
				<input type="Text" name="billphone" value="#pnphone#" disabled>
				<input type="hidden" name="billphone" value="#pnphone#">
				<input type="hidden" name="emailadd" value="#qryGetuserInfo.emailadd#">
				<br><strong>Phone Number is used for Billing &amp; Order Inquiries only.</strong></td></tr>
				</table>
			<cfelse>
			
			
				<table class="PRODUCTLIST" cellpadding="3" cellspacing="0">
					<tr>
						<tH colspan="2" align="center" valign="top">
						<p align="center">Billing Information</p>
						</tH>
					</tr>
					
					<tr>
						<td valign="bottom" align="left"><br>First Name:
						<br>
						<input type="Text" size="15" name="fname"<cfif parameterexists(qryGetuserInfo.fname)is "yes">value="#qryGetuserInfo.fname#"</cfif> ></td>
						<td valign="bottom" align="left" <cfif parameterexists(qryGetuserInfo.fname)is "yes">value="#qryGetuserInfo.fname#"</cfif><cfif parameterexists(qryGetuserInfo.fname)is "yes">value="#qryGetuserInfo.fname#"</cfif>><br>Middle Inital:
						<br><input type="Text" size="1" name="mni" maxlength="1" <cfif parameterexists(qryGetuserInfo.mni)is "yes">value="#qryGetuserInfo.mni#"</cfif>></td>
					</tr>
					<tr>
						<td>Last Name:<br>
						<input type="Text" size="18" name="lname" <cfif parameterexists(qryGetuserInfo.lname)is "yes">value="#qryGetuserInfo.lname#"</cfif>></td>
						<td>&nbsp;</td>
					</tr>
					<tr>
					<td colspan="2">Address1:<br>
				
					<input type="Text" size="18" name="billadd1" <cfif parameterexists(qryGetuserInfo.billadd1)is "yes">value="#qryGetuserInfo.billadd1#"</cfif>>
					
					</td>
					</tr>
					<tr>
					<td colspan="2">Address2:<br>
						<input type="Text" size="18" name="billadd2" <cfif parameterexists(qryGetuserInfo.billadd2)is "yes">value="#qryGetuserInfo.billadd2#"</cfif>></td>
					</tr>
					
					<tr>
					<td colspan="2">City:<br>
						<input type="Text" size="18" name="billcity" <cfif parameterexists(qryGetuserInfo.billcity)is "yes">value="#qryGetuserInfo.billcity#"</cfif>>
						
						</td>
					</tr>
					
					<tr>
					<td>State:<br>
					<select size="1" name="billstate" >
          	<cfif parameterexists(qryGetuserInfo.billstate)is "yes"><OPTION selected  value="#qryGetuserInfo.billstate#">#qryGetuserInfo.billstate#</option>
			</cfif>
		 <option value="AB">AB</option>
          <option value="AL">AL</option>
          <option value="AK">AK</option>
          <option value="AZ">AZ</option>
          <option value="AR">AR</option>
		  <option value="BC">BC</option>
          <option value="CA">CA</option>
          <option value="CO">CO</option>
          <option value="CT">CT</option>
          <option value="DE">DE</option>
          <option value="DC">DC</option>
          <option value="FL">FL</option>
          <option value="GA">GA</option>
          <option value="HI">HI</option>
          <option value="ID">ID</option>
          <option value="IL">IL</option>
          <option value="IN">IN</option>
          <option value="IA">IA</option>
          <option value="KS">KS</option>
          <option value="KY">KY</option>
          <option value="LA">LA</option>
		  <option value="MB">MB</option>
          <option value="ME">ME</option>
          <option value="MD">MD</option>
          <option value="MA">MA</option>
          <option value="MI">MI</option>
          <option value="MN">MN</option>
          <option value="MS">MS</option>
          <option value="MO">MO</option>
          <option value="MT">MT</option>
		  <option value="NE">NE</option>
          <option value="NB">NB</option>
		  <option value="NF">NF</option>
		  <option value="NT">NT</option>
		  <option value="NS">NS</option>
          <option value="NV">NV</option>
          <option value="NH">NH</option>
          <option value="NJ">NJ</option>
          <option value="NM">NM</option>
          <option value="NY">NY</option>
          <option value="NC">NC</option>
          <option value="ND">ND</option>
          <option value="OH">OH</option>
          <option value="OK">OK</option>
		  <option value="ON">ON</option>
          <option value="OR">OR</option>
          <option value="PA">PA</option>
		  <option value="PE">PE</option>
		  <option value="QC">QC</option>
          <option value="RI">RI</option>
          <option value="SC">SC</option>
          <option value="SD">SD</option>
		  <option value="SK">SK</option>
          <option value="TN">TN</option>
          <option value="TX">TX</option>
          <option value="UT">UT</option>
          <option value="VT">VT</option>
          <option value="VA">VA</option>
          <option value="WA">WA</option>
          <option value="WV">WV</option>
          <option value="WI">WI</option>
          <option value="WY">WY</option>
		  <option value="YK">YK</option>
        </select></td>
					<td>Zip: <input type="Text" size="6" name="billzip" <cfif parameterexists(qryGetuserInfo.billzip)is "yes"> value="#qryGetuserInfo.billzip#"</cfif> ></td>
					</tr>
				<tr class="PRODUCTLIST"><td colspan="2">Email Address: <input type="Text" name="emailadd" <cfif parameterexists(qryGetuserInfo.emailadd)is "yes"> value="#qryGetuserInfo.emailadd#" </cfif>>
								<br><strong>Email used for Order Shipping &amp; Confirmation Notification.</strong></td></tr>
				</td></tr>
				<tr class="PRODUCTLIST"><td colspan="2">Billing Phone: (Required) <input type="Text" name="billphone" 
				<cfif parameterexists(qryGetuserInfo.phonecontact)is "yes">
				 value="#qryGetuserInfo.phonecontact#" 
				 </cfif>>
				<br><strong>Phone Number is used for Billing &amp; Order Inquiries only.</strong></td></tr>
				</table>
			</cfif>
			<!--- end of pncode for billing --->
			</td>
			<td valign="top">
			<cfif parameterexists(pncode) is "YES">
			<table class="PRODUCTLIST" bgcolor="F2F2F2">
				
					<tr>
						<tH colspan="2" align="center" valign="top">
						Shipping Information:
						<p align="center">
						
						</p>
						</tH>
					</tr>
					<tr>
						<td>
						<input type="text" name="pnDealer" value="#pndealer#" disabled size="35">
						<input type="Hidden" name="shipfname" value="#pndealer#">
						<input type="Hidden" name="shipLname" value=" ">
						<input type="Hidden" name="shipmni" value="">
						<input type="Hidden" name="sabbutton" value="1" >
						</td>
					</tr>											
					<tr>
					<td colspan="2">Address1:<br>
						<input type="Text" size="30" name="shipadd1" value="#pnaddress#" disabled>
						<input type="Hidden" name="shipadd1" value="#pnaddress#">
						<input type="Hidden" name="shipadd2" value="">
						</td>
					</tr>
					<!--- <tr>
					<td colspan="2">Address2:<br>
						<input type="Text" size="18" name="shipadd2"></td>
					</tr> --->
					<tr>
						<td colspan="2">City:<br>
							<input type="Text" size="30" name="shipcity" value="#pncity#" disabled>
							<input type="Hidden" name="shipcity" value="#pncity#">
							</td>
					</tr>
				
					<tr>
					<td>State:<br><input type="Text" name="shipstate" value="#pnstate#" disabled size="1">
					<input type="Hidden" name="shipstate" value="#pnstate#">
          			</td>
					<td>Zip: <input type="Text" size="6" name="shipzip" value="#pnzip#" disabled>
					<input type="Hidden" name="shipzip" value="#pnzip#">
					</td>
					</tr>
				<tr class="PRODUCTLIST"><td colspan="2">Ship Location Phone: <input type="Text" name="shipphone" value="#pnphone#" disabled>
					<input type="Hidden" name="shipphone" value="#pnphone#">
				</td></tr>

				</table>
			<cfelse>
			<table class="PRODUCTLIST" bgcolor="F2F2F2">
				<cfif parameterexists(taxcode) is "No">
					<tr>
						<tH colspan="2" align="center" valign="top">
						Shipping Information<br><input type="Checkbox" name="sabbutton"> Same as Billing
						</tH>
					</tr>
				<cfelse>
				<tr>
						<tH colspan="2" align="center" valign="top">
						Shipping Information<br><input type="Checkbox" name="sabbutton" disabled> Same as Billing
						</tH>
				</tr>
				</cfif>
					<tr>
						<td valign="bottom" align="left"><br>First Name:
						<br><input type="Text" size="15" name="shipfname"></td>
						<td valign="bottom" align="left"><br>Middle Inital:
						<br><input type="Text" size="1" maxlength="1" name="shipmni"></td>
					</tr>
					
					<tr>
						<td>Last Name:<br>
						<input type="Text" size="18" name="shiplname"></td>
						<td>&nbsp;</td>
					</tr>
					
					<tr>
					<td colspan="2">Address1:<br>
						<input type="Text" size="18" name="shipadd1"></td>
					</tr>
					<tr>
					<td colspan="2">Address2:<br>
						<input type="Text" size="18" name="shipadd2"></td>
					</tr>
					
			<cfif parameterexists(taxcode) is "no">
					<tr>
					<td colspan="2">City:<br>
						<input type="Text" size="18" name="shipcity"></td>
					</tr>
					<cfelse>
					<tr>
					<td colspan="2">City:<br>
						<input type="Text" size="18" name="shipcity" value="#cityTax#" disabled>
						<input type="Hidden" name="shipcity" value="#cityTax#">
						<input type="Hidden" name="zipcounty" value="#zipcounty#">
					</td>
					</tr>
					</cfif>
		
					<tr>
					<td>State:<br>
					<cfif parameterexists(taxcode) is "no">
					<select size="1" name="shipstate">
          	<OPTION selected></OPTION>
		  <option value="AB">AB</option>
          <option value="AL">AL</option>
          <option value="AK">AK</option>
          <option value="AZ">AZ</option>
          <option value="AR">AR</option>
		  <option value="BC">BC</option>
          <option value="CA">CA</option>
          <option value="CO">CO</option>
          <option value="CT">CT</option>
          <option value="DE">DE</option>
          <option value="DC">DC</option>
          <option value="FL">FL</option>
          <option value="GA">GA</option>
          <option value="HI">HI</option>
          <option value="ID">ID</option>
          <option value="IL">IL</option>
          <option value="IN">IN</option>
          <option value="IA">IA</option>
          <option value="KS">KS</option>
          <option value="KY">KY</option>
          <option value="LA">LA</option>
		  <option value="MB">MB</option>
          <option value="ME">ME</option>
          <option value="MD">MD</option>
          <option value="MA">MA</option>
          <option value="MI">MI</option>
          <option value="MN">MN</option>
          <option value="MS">MS</option>
          <option value="MO">MO</option>
          <option value="MT">MT</option>
		  <option value="NE">NE</option>
          <option value="NB">NB</option>
		  <option value="NF">NF</option>
		  <option value="NT">NT</option>
		  <option value="NS">NS</option>
          <option value="NV">NV</option>
          <option value="NH">NH</option>
          <option value="NJ">NJ</option>
          <option value="NM">NM</option>
          <option value="NY">NY</option>
          <option value="NC">NC</option>
          <option value="ND">ND</option>
          <option value="OH">OH</option>
          <option value="OK">OK</option>
		  <option value="ON">ON</option>
          <option value="OR">OR</option>
          <option value="PA">PA</option>
		  <option value="PE">PE</option>
		  <option value="QC">QC</option>
          <option value="RI">RI</option>
          <option value="SC">SC</option>
          <option value="SD">SD</option>
		  <option value="SK">SK</option>
          <option value="TN">TN</option>
          <option value="TX">TX</option>
          <option value="UT">UT</option>
          <option value="VT">VT</option>
          <option value="VA">VA</option>
          <option value="WA">WA</option>
          <option value="WV">WV</option>
          <option value="WI">WI</option>
          <option value="WY">WY</option>
		  <option value="YK">YK</option>
        </select>
		<cfelse>
		<input type="Text" size="1" name="shipcity" value="#taxState#" disabled>
		<input type="Hidden" name="shipstate" value="#taxState#">
		</cfif>
		</td>
					<cfif parameterexists(taxcode) is "no">
					<td>Zip: <input type="Text" size="6" name="shipzip">
					</td>
					<cfelse>
					<td>Zip: <input type="Text" size="6" name="shipzip" value="#taxZip#" disabled>
							<input type="Hidden" name="shipzip" value="#taxZip#">	
					</td>
					</cfif>
					</tr>
				<tr class="PRODUCTLIST"><td colspan="2">Ship Location Phone: <input type="Text" name="shipphone"></td></tr>

				</table>
</cfif>
			</td>
		</tr>
<cfif totprice lt 1><cfset ccBill = "no"></cfif>
<cfif ccBill neq "no">
<tr class="PRODUCTHEAD" bgcolor="006699">



<td align="center" colspan="2" style="color: white;">Payment Method: 
<SELECT NAME="CardType">
<OPTION SELECTED value="">Choose One
<OPTION value="VI">Visa
<OPTION value="MC">Master Card
<Option value="AM">American Express
<OPTION value="DS">Discover
</SELECT></td></tr>

<tr class="PRODUCTLIST"><td colspan="2">Card Number (NO Spaces or Dashes Please): <input type="Text" name="CardNumber"></td></tr>
<tr class="PRODUCTLIST"><td colspan="2">Name On Card: <input type="Text" name="cardname">Month: <select name="ExpMon">
<option selected></option>
<option value="01">01
<option value="02">02
<option value="03">03
<option value="04">04
<option value="05">05
<option value="06">06
<option value="07">07
<option value="08">08
<option value="09">09
<option value="10">10
<option value="11">11
<option value="12">12
</select>
Year: <select name="ExpYear"<cfif parameterexists(cookie.pncode) is "yes" and cookie.pncode gt ""> disabled ></cfif>>
<option selected></option>
<option value="04">04
<option value="05">05
<option value="06">06
<option value="07">07
<option value="08">08
<option value="09">09
<option value="10">10
</select></td></tr>
</cfif>


<tr class="PRODUCTLIST"><td colspan="2" align="center">
<cfif parameterexists(pncode) is "yes">
	<cfset accountcode = "1161">
<cfelse>
	<cfset accountcode ="1163">
</cfif>
<input type="Hidden" name="accountcode" value="#accountcode#">
 <cfif parameterexists(ccBill) is "yes" AND ccBill eq "no">
 	<input type="Hidden" name="paymenttype" value="No">
 </cfif>
 <cfif parameterexists(salestax) is "yes" AND salestax gt 0>
 	<input type="Hidden" name="salestax" value="#salestax#">
 </cfif>
<cfif parameterexists(pncode) is "yes">
	<input type="Hidden" name="pncode" value="#pncode#">
</cfif>
<cfif ccBill neq "no">
<input type="Submit" value="Submit Order" OnClick="CheckCardNumber(this.form)">
<CFELSE>
<input type="Submit" value="Submit Order">
</cfif>
</td></tr>

	</form>
	</cfoutput></table>
</td>


</table>



More information about the Javascript mailing list