Link to home
Start Free TrialLog in
Avatar of judsonmusic
judsonmusicFlag for United States of America

asked on

form field values coming back duplicated!

I have a form that a user uses to submit credit card payment to an API.

if the payment fails, it comes back to the page to have them re-enter the information.

The first time is fails, everything looks normal. it comes back with the previously entered information all filled in nicely.

but when they try again(2nd time), and it declines, the info comes back duplicated in the form feilds separated by a comma!!!! The more you submit, the more it appends the values!

its only happening on my person values that I am passing to the API(the user information up top in SS)

I know that the api passes back the values in the HTTP method through the URL, but why is it appending each time they come back?

How can I prevent this??

I have added screenshots so you can see the issue. I have also attached some code.

Judson User generated image User generated image User generated image

<!---PARAMS SET HERE!------------------------>
<cfparam name="return_code" default="Y">

<cfparam name="Form.APPTYPE" default="">
<cfparam name="FORM.ACCTTYPE" default="">
<cfparam name="FORM.EMAIL" default="">
<cfparam name="FORM.licenses" default="0">
<cfparam name="FORM.tier" default="0">

<!---CREDIT CARD PARAMS--->
<cfparam name="FORM.AMOUNT" default="95.00">
<cfparam name="FORM.NAME" default="">
<cfparam name="FORM.STREET" default="">
<cfparam name="FORM.CITY" default="">
<cfparam name="FORM.STATE" default="">
<cfparam name="FORM.ZIP" default="">
<cfparam name="FORM.CARDTYPE" default="">
<cfparam name="FORM.CC_NUMBER" default="">
<cfparam name="FORM.MONTH" default="">
<cfparam name="FORM.YEAR" default="">
<cfparam name="FORM.TOTAL" default="0.00">
<cfparam name="FORM.PAYTYPE" default="">




<!---USER PARAMS--->
<cfparam name="FORM.USER_FSTNAM"  default="">
<cfparam name="FORM.USER_LSTNAM"  default="">
<cfparam name="FORM.USER_ADDRESS" default="">
<cfparam name="FORM.USER_ADDRESS2" default="">
<cfparam name="FORM.USER_CITY"  default="">
<cfparam name="FORM.USER_STATE" default="">
<cfparam name="FORM.USER_ZIP" default="">
<cfparam name="FORM.USER_PASSWORD" default="">
<cfparam name="FORM.USER_PHONE" default="">
<cfparam name="FORM.USER_EXT"  default="">

<cfparam name="FORM.COMPANY_NAME" default="">
<cfparam name="FORM.COMPANY_TITLE"  default="">


<!--- user personal info...This is whats getting duplicated!--->

<table width="740" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td width="223">First Name<br />
     <cfoutput> <input type="text" name="user_fstnam" id="user_fstnam" style="width:130px" value="#FORM.user_fstnam#"/></cfoutput></td>
    <td width="8">Last Name<br />
      <cfoutput><input type="text" name="user_lstnam" id="user_lstnam" style="width:130px" value="#form.user_lstnam#" /></cfoutput></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>Address <br />
     <cfoutput> <input type="text" name="user_address" id="user_address" style="width:130px" value="#form.user_address#" /></cfoutput></td>
    <td>Apt / Unit / Suite <br />
     <cfoutput> <input type="text" name="user_address2" id="user_address2" style="width:60px" value="#form.user_address2#" /></cfoutput></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>City <br />
     <cfoutput> <input type="text" name="user_city" id="user_city" style="width:130px" value="#form.user_city#" /> </cfoutput>     <br /></td>
    <td>State<br />
      <select name="user_state" id="user_state">
      <cfif form.state NEQ ''>
        <cfoutput>
          <option value="#form.user_state#" selected="selected">#form.user_state#</option>
          </cfoutput>
          <cfelse>
          <option value="" selected="selected">Please select</option>
          </cfif>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        <option value="AR">Arkansas</option>
        <option value="CA">California</option>
        <option value="CO">Colorado</option>
        <option value="CT">Connecticut</option>
        <option value="DE">Delaware</option>
        <option value="DC">District of Columbia</option>
        <option value="FL">Florida</option>
        <option value="GA">Georgia</option>
        <option value="HI">Hawaii</option>
        <option value="ID">Idaho</option>
        <option value="IL">Illinois</option>
        <option value="IN">Indiana</option>
        <option value="IA">Iowa</option>
        <option value="KS">Kansas</option>
        <option value="KY">Kentucky</option>
        <option value="LA">Louisiana</option>
        <option value="ME">Maine</option>
        <option value="MD">Maryland</option>
        <option value="MA">Massachusetts</option>
        <option value="MI">Michigan</option>
        <option value="MN">Minnesota</option>
        <option value="MS">Mississippi</option>
        <option value="MO">Missouri</option>
        <option value="MT">Montana</option>
        <option value="NE">Nebraska</option>
        <option value="NV">Nevada</option>
        <option value="NH">New Hampshire</option>
        <option value="NJ">New Jersey</option>
        <option value="NM">New Mexico</option>
        <option value="NY">New York</option>
        <option value="NC">North Carolina</option>
        <option value="ND">North Dakota</option>
        <option value="OH">Ohio</option>
        <option value="OK">Oklahoma</option>
        <option value="OR">Oregon</option>
        <option value="PA">Pennsylvania</option>
        <option value="RI">Rhode Island</option>
        <option value="SC">South Carolina</option>
        <option value="SD">South Dakota</option>
        <option value="TN">Tennessee</option>
        <option value="TX">Texas</option>
        <option value="UT">Utah</option>
        <option value="VT">Vermont</option>
        <option value="VA">Virginia</option>
        <option value="WA">Washington</option>
        <option value="WV">West Virginia</option>
        <option value="WI">Wisconsin</option>
        <option value="WY">Wyoming</option>
      </select></td>
    <td colspan="3">Zip <br />
      <cfinput type="text" name="user_zip"  id="user_zip" style="width:48px" maxlength="5" value="#form.user_zip#"  mask="99999"/></td>
    </tr>
  <tr>
    <td>Phone<br />
      <cfinput type="text" name="user_phone" mask="999-999-9999" validate="telephone"  id="user_phone" style="width:84px" maxlength="12"  value="#form.user_phone#" /></td>
    <td>Ext.<br />
      <cfinput type="text" name="user_ext" mask="99999" validate="integer" id="user_ext" style="width:36px"  maxlength="5"  value="#form.user_ext#"/></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>Email Address<span style="color:red; font-style:italic">(will be your username)</span><br />
      <cfinput type="text" name="EMAIL" id="EMAIL" style="width:130px" value="#form.email#"/></td>
    <td colspan="4">Password <span style="color:red; font-style:italic">(for SecureMail access)</span><br />
      <cfinput type="text" name="user_password" id="user_password" style="width:130px"  value="#form.user_password#"/></td>
    </tr>
   <cfif form.appType EQ 'trial'>
        <tr>
        <td colspan="98"><input name="validateUserTrial" id="validateUserTrial" type="checkbox" onclick="validateUserInfoTrial();" /> Check this box when finished&nbsp;</td>
        </tr>
  <cfelse>
  <tr>
    <td colspan="98"><input name="validateUser" id="validateUser" type="checkbox" onclick="validateUserInfo();"/> Check this box when finished&nbsp;</td>
    </tr>
    </cfif>
</table>

Open in new window

Avatar of _agx_
_agx_
Flag of United States of America image

>> I know that the api passes back the values in the HTTP method through the URL,
>> but why is it appending each time they come back?

Are you sure that's actually when the duplication is happening? It's more likely something in your code accidentally duplicating the values, rather than the API passing back duplicate values.

>> if the payment fails, it comes back to the page to have them re-enter the information.

... for example, accidentally _appending_ values when an error occurs. So the values passed back to the FORM page are duplicated.  

Can you post the code for that process?
Avatar of judsonmusic

ASKER

It's a simple form.submit. The action URL is their API URL for success and for failure. I just have the failure one coming back to my page. It's simple then I am just retaining my form values as shown in my code. I'm not setting anything or calling anything.
>> I just have the failure one coming back to my page.

So _they're_ redirecting the user back to your page (ie you're not doing anything on your site)? Then that DOES suggest the duplicated values are coming from the vendor.  

What happens if you dump the FORM and http request right at the top of your page?  If the values are duplicated _directly_ after the vendor redirect, then it is a problem with their API and you'd probably have to ask the vendor.

<cfdump var="#FORM#">
<cfdump var="#getHttpRequestData()#">
... rest of form page ....
<!---PARAMS SET HERE!------------------------>
<cfparam name="return_code" default="Y">
.....


>> So _they're_ redirecting the user back to your page (ie you're not doing anything on your site)?

      BUT ... if _you_ are doing all of the redirection in CF code. Then it's more likely a
      problem with your redirection code.  That's why I asked if you could post it.
Are you using the same form field name for "zip" on both the personal and credit card form sections?  The proper thing to submit if you have to fields with the same name is to comma delimit them.
Hmm. If all of the fields are contained in the same form AND have the same names, well ... they shouldn't.  Obviously if you give 2+ fields the same name, the values will ALWAYS be returned as a comma separated list

ie  This would return "Judson,Judson"
     <form ...>
         <input name="firstName" value="Judson">
         <input name="firstName" value="Judson">
    </form>

To prevent that from happening, you must give the fields different names.  

    <input name="firstNamePersonalSection" ...>
    <input name="firstNameCreditSection" ...>

>> The proper thing to submit if you have to fields with the same name is to comma delimit them.

    That should be only be done in certain situations, and IMO, *never* with names or other
    string fields.  The reason is string _values_ might contain commas, which would cause
    you to get the wrong results when you tried to extract the values.

   
I have trouble wording things sometimes.  What I meant by " The proper thing to submit if you have to fields with the same name is to comma delimit them." was that it was proper for the browser to make a comma delimited list out of form field data if more than one field has the same name.  Their has only been 2 cases in my years of programming where I did that on purpose and wanted that to happen.  In most cases you will want all fields to have different names unless its a radio button.
>> has only been 2 cases in my years of programming where I did that on purpose
>> and wanted that to happen

I tend to use same name fields frequently. But only with fields storing numeric values. It can be very useful for multiple selection queries or deletes.  Since you can pass a list of id's to a query using a WHERE ColumnValue IN (....) clause.  But yeah, it should be done deliberately.

BTW: The reason I mentioned not using it for string fields is I've seen a lot of questions on EE where people have done that. Then can't figure out why they're getting the wrong results when they try and extract the values with list functions ;-)
ok guys, I am very happy with all of the attention to this. I really need to get this resolved today. Here is the whole page of code...


Thanks in advance for your help. I'm not a beginner, but this has got me puzzled!

:) JUDSON


<cfajaximport tags="CFINPUT-DATEFIELD, CFWINDOW, CFFORM">
<cfparam name="session.norefresh" default="false">
<cfset session.norefresh = 'false'>
<cfparam name="url.type" default="company">
<cfparam name="url.trial" default="no">

<cfif url.trial EQ 'yes'>
    <cfset form.appType = 'trial'>
</cfif>


<cfparam name="return_code" default="Y">

<cfparam name="Form.APPTYPE" default="">
<cfparam name="FORM.ACCTTYPE" default="">
<cfparam name="FORM.EMAIL" default="">
<cfparam name="FORM.licenses" default="0">
<cfparam name="FORM.tier" default="0">

<!---CREDIT CARD PARAMS--->
<cfparam name="FORM.AMOUNT" default="95.00">
<cfparam name="FORM.NAME" default="">
<cfparam name="FORM.STREET" default="">
<cfparam name="FORM.CITY" default="">
<cfparam name="FORM.STATE" default="">
<cfparam name="FORM.ZIP" default="">
<cfparam name="FORM.CARDTYPE" default="">
<cfparam name="FORM.CC_NUMBER" default="">
<cfparam name="FORM.MONTH" default="">
<cfparam name="FORM.YEAR" default="">
<cfparam name="FORM.TOTAL" default="0.00">
<cfparam name="FORM.PAYTYPE" default="">




<!---USER PARAMS--->
<cfparam name="FORM.USER_FSTNAM"  default="">
<cfparam name="FORM.USER_LSTNAM"  default="">
<cfparam name="FORM.USER_ADDRESS" default="">
<cfparam name="FORM.USER_ADDRESS2" default="">
<cfparam name="FORM.USER_CITY"  default="">
<cfparam name="FORM.USER_STATE" default="">
<cfparam name="FORM.USER_ZIP" default="">
<cfparam name="FORM.USER_PASSWORD" default="">
<cfparam name="FORM.USER_PHONE" default="">
<cfparam name="FORM.USER_EXT"  default="">

<cfparam name="FORM.COMPANY_NAME" default="">
<cfparam name="FORM.COMPANY_TITLE"  default="">







<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>SecureMail</title>
<!---KEEP USER FROM BOOKMARKING PAGES!--->
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
<cfheader name="expires" value="#now()#">
<cfheader name="pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta name="keywords" content="securemail, secure mail, secure document portal, document portal, document delivery system" />
<meta name="description" content="SecreuMail is a document delivery system developed by Judson Terrell for Healthgram, a product/ brand of Primary PhysicianCare, Inc." />
  
<style type="text/css">
<!--
html, body{
background-color:#333;
background-image:url(images/demoPageBG.jpg);
background-repeat:repeat-x;
padding:0px;
margin:0px;
font-size:11px;
font-family:Arial, Helvetica, sans-serif;

}
.baseMain .leftColumn .linksleftCol a {
font-size: 14px;
color: #FFF;
}
.indexMainholder {
height:auto;
width: 980px;
background-color: #FFF;
margin-right: auto;
margin-left: auto;
}

a {
text-decoration:none


}
.footer {
height: auto;
width: 978px;
margin-right: auto;
margin-left: auto;
text-align: center;
padding-top: 6px;
padding-bottom: 25px;
background-color: #FFF;
border: 1px solid #000;
}
.footer a {
color: #666;
}
.baseMain .footer a {
color: #999;
}

.topAreaInner {
width: 970px;
height: 80px;
margin-right: auto;
margin-left: auto;
position: relative;
}
.topArea .topAreaInner .topAreaCrumbs a {
font-weight: bold;
color: #FFF;
}

.baseMain {
margin-right: auto;
margin-left: auto;
height: auto;
width: 978px;
border: 1px solid #000;
background-color: #999;
}
.shadow {
background-image: url(../../images/bg_shadow.png);
background-repeat: repeat-y;
height: auto;
width: 999px;
margin-right: auto;
margin-left: auto;
}



.leftColumn {
	background-color: #999;
	height: 100%;
	width: 200px;
	float: left;
	min-height:500px;
	background-image: url(../../images/bgLeftColumn.jpg);
	background-repeat: no-repeat;
}
.leftColumn .linksleftCol {
margin-top: 10px;
margin-left: 25px;
}
.topBlue {
height: 10px;
width: 100%;
background-color: #6999C7;
}
.titles1 {
	color: #6E98C0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
}

.topYellow {
background-color: #FEFECA;
height: 5px;
width: 100%;
}

.theContent {
margin: 10px;
}


.rightColumn {
background-color: #FFF;
height: auto;
width: 778px;
float: left;
min-height:500px;
background-image: url(../../images/bgColumnRight.jpg);
background-repeat: no-repeat;
}

.topArea {
background-color: #333;
clear: both;
height: 120px;
width: 100%;
background-image: url(../../images/topAreaSlice.jpg);
background-repeat: repeat-x;
}
.topAreaCrumbs {
width: 240px;
position: absolute;
right: 0px;
bottom: 9px;
}

.borderBox{
	border:1px solid grey;
	padding:10px;
	margin-bottom: 10px;
	background-color: #FFF;	
}
-->
</style>

  </head>
<body> 
<cfif form.appType NEQ 'trial'>
<cfset variables.actionurl = 'https://www.securepay.com/secure15/index.cfm'>
<cfelse>
<cfset variables.actionurl = 'paymentSuccess.cfm?'>
</cfif>

<cfform name="form1" id="form1" action="#variables.actionurl#" method="post">
<input name="SUCCESS_URL" 	type="hidden"	value= 'https://securemail.healthgram.com/paymentSuccess.cfm'>
<input name="FAILURE_URL" 	type="hidden"	value= 'https://securemail.healthgram.com/purchase_options.cfm'>
<input name="FMMETHOD" 		type="hidden"	value= 'POST'>
<input name="MERCH_ID"		type="hidden"	value= '99999'><!---MerchantId assigned by secure pay--->
<input name="SEND_MAIL"		type="hidden"	value= 'Yes'>
<input name="Tr_Type" 		type="hidden"	value= 'SALE'>
<input name="CC_METHOD" 	type="hidden"	value= 'DataEntry'>	
<input name="AVSREQ" 		type="hidden"	value= '0'>
<input name="TRANSKEY" 		type="hidden"	value= 'P5n8zJ93j2tD587v'>
<cfoutput>
<input name="appType"       id="appType" 	type="hidden"	value= '#FORM.appType#'>
</cfoutput>
<input type="hidden"		name="expDate" 	id="expDate" 	value="" />
<input type="hidden"		name="ccNo" 	id="ccNo" 		value="" />
<input type="hidden"		name="tier" 	id="tier" 		value="" />

<div class="topArea">
    <div class="topAreaInner">
    <div class="topAreaLOGO">
      <img src="images/topAreaLOGO.jpg" width="190" height="71" /></div>
    </div>
</div>

<div style="clear:both"></div>


<div style="position:relative; margin:auto; width:999px">   
    <div class="shadow" style="position:absolute; top:-40px;">
    <div class="baseMain">
        <div class="leftColumn">
            <div class="linksleftCol">&nbsp;</div>
            <div class="linksleftCol"><a href="index.cfm">Home</a></div>
            <div class="linksleftCol"><a href="mailto:securemail@healthgram.com">Contact Us</a></div>
        </div>
        
        
        
<div class="rightColumn">
	<div class="theContent" style="min-height:600px;">
                
                
          
                
<div id="option1" class="borderBox" style="display:block; background-color:white">
<cfif form.appType NEQ 'trial'>
<span class="titles1"><a name="About">Purchase Options</a></span>
<p>Thank you for your interest in purchasing SecureMail. Please select the appropriate options below based on your individual or company needs.<br />
  <br />
  Which type of license would you like to purchase?
</p>
<p>
  <div id="IndyCheck">
  <label>
  <input type="radio" name="Accttype" id="individual" onclick="document.getElementById('option2COMPANY').style.display='none'; document.getElementById('licenses').value='1'; document.getElementById('total').value='95.00';" value="individual" <cfif form.apptype EQ 'individual'>checked</cfif>/>
    Individual <span style="color:grey; font-style:italic;">(single license for 7.95 per month*)</span></label>
  <br />
  <br />
  </div>
  <div id="CompanyCheck">
  <input type="radio" name="Accttype" id="company" onclick="document.getElementById('option2USER').style.display='none';" value="company"  <cfif form.apptype EQ 'company'>checked</cfif>/>
  Company <span style="color:grey; font-style:italic;">(multiple licenses)</span>
  </div>
  <cfelse>
  <span class="titles1"><a name="About">Free 30 day trial!</a></span>
  <p>
  Please fill out the following information to receive a free 30 day trial of SecureMail!<br />
<span style="color:grey; font-size:11px;">Please note: After the 30 day trial, your account access will be limited to only receiving and replying to SecureMail. <br />
You WILL NOT be able to send messages unless you purchase a license.</span>
  </p>
  </cfif>
  
</div>




<!---Account Info for user--->
<div id="option2USER" class="borderBox" style="display:none">
<span class="titles1"><a name="About" id="About2">Individual Account Information</a></span><br />
  <br />
Please enter the following information to create your account: <br />
<br />
<table width="740" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td width="223">First Name<br />
     <cfoutput> <input type="text" name="user_fstnam" id="user_fstnam" style="width:130px" value="#FORM.user_fstnam#"/></cfoutput></td>
    <td width="8">Last Name<br />
      <cfoutput><input type="text" name="user_lstnam" id="user_lstnam" style="width:130px" value="#form.user_lstnam#" /></cfoutput></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>Address <br />
     <cfoutput> <input type="text" name="user_address" id="user_address" style="width:130px" value="#form.user_address#" /></cfoutput></td>
    <td>Apt / Unit / Suite <br />
     <cfoutput> <input type="text" name="user_address2" id="user_address2" style="width:60px" value="#form.user_address2#" /></cfoutput></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>City <br />
     <cfoutput> <input type="text" name="user_city" id="user_city" style="width:130px" value="#form.user_city#" /> </cfoutput>     <br /></td>
    <td>State<br />
      <select name="user_state" id="user_state">
      <cfif form.state NEQ ''>
        <cfoutput>
          <option value="#form.user_state#" selected="selected">#form.user_state#</option>
          </cfoutput>
          <cfelse>
          <option value="" selected="selected">Please select</option>
          </cfif>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        <option value="AR">Arkansas</option>
        <option value="CA">California</option>
        <option value="CO">Colorado</option>
        <option value="CT">Connecticut</option>
        <option value="DE">Delaware</option>
        <option value="DC">District of Columbia</option>
        <option value="FL">Florida</option>
        <option value="GA">Georgia</option>
        <option value="HI">Hawaii</option>
        <option value="ID">Idaho</option>
        <option value="IL">Illinois</option>
        <option value="IN">Indiana</option>
        <option value="IA">Iowa</option>
        <option value="KS">Kansas</option>
        <option value="KY">Kentucky</option>
        <option value="LA">Louisiana</option>
        <option value="ME">Maine</option>
        <option value="MD">Maryland</option>
        <option value="MA">Massachusetts</option>
        <option value="MI">Michigan</option>
        <option value="MN">Minnesota</option>
        <option value="MS">Mississippi</option>
        <option value="MO">Missouri</option>
        <option value="MT">Montana</option>
        <option value="NE">Nebraska</option>
        <option value="NV">Nevada</option>
        <option value="NH">New Hampshire</option>
        <option value="NJ">New Jersey</option>
        <option value="NM">New Mexico</option>
        <option value="NY">New York</option>
        <option value="NC">North Carolina</option>
        <option value="ND">North Dakota</option>
        <option value="OH">Ohio</option>
        <option value="OK">Oklahoma</option>
        <option value="OR">Oregon</option>
        <option value="PA">Pennsylvania</option>
        <option value="RI">Rhode Island</option>
        <option value="SC">South Carolina</option>
        <option value="SD">South Dakota</option>
        <option value="TN">Tennessee</option>
        <option value="TX">Texas</option>
        <option value="UT">Utah</option>
        <option value="VT">Vermont</option>
        <option value="VA">Virginia</option>
        <option value="WA">Washington</option>
        <option value="WV">West Virginia</option>
        <option value="WI">Wisconsin</option>
        <option value="WY">Wyoming</option>
      </select></td>
    <td colspan="3">Zip <br />
      <cfinput type="text" name="user_zip"  id="user_zip" style="width:48px" maxlength="5" value="#form.user_zip#"  mask="99999"/></td>
    </tr>
  <tr>
    <td>Phone<br />
      <cfinput type="text" name="user_phone" mask="999-999-9999" validate="telephone"  id="user_phone" style="width:84px" maxlength="12"  value="#form.user_phone#" /></td>
    <td>Ext.<br />
      <cfinput type="text" name="user_ext" mask="99999" validate="integer" id="user_ext" style="width:36px"  maxlength="5"  value="#form.user_ext#"/></td>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>Email Address<span style="color:red; font-style:italic">(will be your username)</span><br />
      <cfinput type="text" name="EMAIL" id="EMAIL" style="width:130px" value="#form.email#"/></td>
    <td colspan="4">Password <span style="color:red; font-style:italic">(for SecureMail access)</span><br />
      <cfinput type="text" name="user_password" id="user_password" style="width:130px"  value="#form.user_password#"/></td>
    </tr>
   <cfif form.appType EQ 'trial'>
        <tr>
        <td colspan="98"><input name="validateUserTrial" id="validateUserTrial" type="checkbox" onclick="validateUserInfoTrial()" /> Check this box when finished&nbsp;</td>
        </tr>
  <cfelse>
  <tr>
    <td colspan="98"><input name="validateUser" id="validateUser" type="checkbox" onclick="validateUserInfo();"/> Check this box when finished&nbsp;</td>
    </tr>
    </cfif>
</table>
</div><!---END OPTION 2USER--->

<!---Company tiers.--->
 <div id="option3" style="display:none" class="borderBox">
 <span class="titles1"><a name="tier" id="tier" class="scroll">Company Tier Options</a></span>
 <br />
<br />
Below is the current pricing list. (* Tiers must be paid in 1 year increments.)
<br />
<br />
<table width="496" border="0" cellpadding="4" cellspacing="0" style="border: 1px solid grey">
  <tr bgcolor="#B0CAFF">
    <td width="35" align="center">Tier</td>
    <td width="157">Amount</td>
    <td width="136">Number of licenses</td>
    <td width="136">Space</td>
  </tr>
  <tr>
    <td align="center">1</td>
    <td>7.95 <span style="color:grey; font-size:11px; font-style:italic">(per month, per license)</span></td>
    <td>0-9 licenses</td>
    <td>10GB</td>
  </tr>
  <tr>
    <td align="center">2</td>
    <td>6.75 <span style="color:grey; font-size:11px; font-style:italic">(per month, per license)</span></td>
    <td>10-49  licenses</td>
    <td>100GB</td>
  </tr>
  <tr>
    <td align="center">3</td>
    <td>5.45 <span style="color:grey; font-size:11px; font-style:italic">(per month, per license)</span></td>
    <td>50-99  licenses</td>
    <td>250GB</td>
  </tr>
  <tr>
    <td align="center">4</td>
    <td>3.75 <span style="color:grey; font-size:11px; font-style:italic">(per month, per license)</span></td>
    <td>100 +  licenses</td>
    <td>500GB</td>
  </tr>
</table>
<br />
<strong>Enter the number of licenses would you like to purchase then click 'calculate'?</strong>
<cfinput name="licenses" type="text" id="licenses" style="width:30px"  maxlength="3" validate="integer" onBlur="calcTotal();" value="#form.licenses#" onfocus="this.value=''"/>
&nbsp;<strong>Total:</strong> $&nbsp;
<cfinput name="total" id="total" type="text" style="width:48px; border:1px solid green; color:green; text-align:right" readonly="readonly" value="#form.total#"/>
yr. </span>
<label>
  <input type="button" name="calculate" id="calculate" value="Calculate!" onclick="calcTotal()"/>
</label>
<br />
<br />
<input name="tierCheck" id="tierCheck" type="checkbox" value="" /> Check this box when finished.
 </div><!---END OPTION 3--->

<!---Account Info for COMPANY--->
<div id="option2COMPANY" class="borderBox" style="display:none">
<span class="titles1"><a name="About" id="About2">Company Account Information</a></span><br />
  <br />
Please enter the information about yourself or the company you are purchasing SecureMail for. <br />
<br />
<table width="760" border="0" cellpadding="4" cellspacing="0">
<tr>
<td>Company Name<br />
<cfinput type="text" name="company_name" id="company_name" style="width:130px" value="#form.company_name#"/></td>
<td>&nbsp;</td>
<td>Your title with company<br />
<cfinput type="text" name="title" id="company_title" style="width:130px" value="#form.company_title#"/></td>
<td>&nbsp;</td>
</tr>
  <tr>
    <td width="223">Your First Name<br />
      <cfinput type="text" name="user_fstnam" id="company_fstnam" style="width:130px" value="#form.user_fstnam#"/></td>
    <td width="8">&nbsp;</td>
    <td width="150">Company Address
      <br />
      <cfinput type="text" name="user_address" id="company_address" style="width:130px" value="#form.user_address#" /></td>
    <td width="5">&nbsp;</td>
    <td width="334"> Suite/ Floor<br />
      <cfinput type="text" name="user_address2" id="company_address2" style="width:60px" value="#form.user_address2#" /></td>
    </tr>
  <tr>
    <td>Your Last Name<br />
      <cfinput type="text" name="user_lstnam" id="company_lstnam" style="width:130px" value="#form.user_lstnam#" /></td>
    <td>&nbsp;</td>
    <td>Company City
      <br />
      <cfinput type="text" name="user_city" id="company_city" style="width:130px" value="#form.user_city#" /></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
  <tr>
   <td>Email Address<span style="color:red; font-style:italic">(will be your username)</span><br />
      <cfinput type="text" name="EMAIL" id="company_EMAIL" style="width:130px" value="#form.email#"/>
      <br /></td>
    <td>&nbsp;</td>
    <td> Company State<br />
      <select name="user_state" id="company_state">
         <cfif form.state NEQ ''>
        <cfoutput>
          <option value="#form.user_state#" selected="selected">#form.user_state#</option>
          </cfoutput>
          <cfelse>
          <option value="" selected="selected">Please select</option>
          </cfif>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        <option value="AR">Arkansas</option>
        <option value="CA">California</option>
        <option value="CO">Colorado</option>
        <option value="CT">Connecticut</option>
        <option value="DE">Delaware</option>
        <option value="DC">District of Columbia</option>
        <option value="FL">Florida</option>
        <option value="GA">Georgia</option>
        <option value="HI">Hawaii</option>
        <option value="ID">Idaho</option>
        <option value="IL">Illinois</option>
        <option value="IN">Indiana</option>
        <option value="IA">Iowa</option>
        <option value="KS">Kansas</option>
        <option value="KY">Kentucky</option>
        <option value="LA">Louisiana</option>
        <option value="ME">Maine</option>
        <option value="MD">Maryland</option>
        <option value="MA">Massachusetts</option>
        <option value="MI">Michigan</option>
        <option value="MN">Minnesota</option>
        <option value="MS">Mississippi</option>
        <option value="MO">Missouri</option>
        <option value="MT">Montana</option>
        <option value="NE">Nebraska</option>
        <option value="NV">Nevada</option>
        <option value="NH">New Hampshire</option>
        <option value="NJ">New Jersey</option>
        <option value="NM">New Mexico</option>
        <option value="NY">New York</option>
        <option value="NC">North Carolina</option>
        <option value="ND">North Dakota</option>
        <option value="OH">Ohio</option>
        <option value="OK">Oklahoma</option>
        <option value="OR">Oregon</option>
        <option value="PA">Pennsylvania</option>
        <option value="RI">Rhode Island</option>
        <option value="SC">South Carolina</option>
        <option value="SD">South Dakota</option>
        <option value="TN">Tennessee</option>
        <option value="TX">Texas</option>
        <option value="UT">Utah</option>
        <option value="VT">Vermont</option>
        <option value="VA">Virginia</option>
        <option value="WA">Washington</option>
        <option value="WV">West Virginia</option>
        <option value="WI">Wisconsin</option>
        <option value="WY">Wyoming</option>
      </select>
</td>
    <td>&nbsp;</td>
    <td>Company Zip
      <br />
      <cfinput type="text" name="user_zip"  id="company_zip" style="width:48px" maxlength="5" value="#form.user_zip#" mask="99999"/>
</td>
    </tr>
  <tr>
    <td>Password for this account<br />
      <cfinput type="text" name="user_password" id="company_password" style="width:130px" value="#form.user_password#" />
     </td>
    <td>&nbsp;</td>
    <td>Company Phone<br />
      <cfinput type="text" name="user_phone" mask="999-999-9999" validate="telephone"  id="company_phone" style="width:84px" maxlength="12" value="#form.user_phone#" />
    </td>
    <td>&nbsp;</td>
    <td>Your Ext.<br />
        <cfinput type="text" name="user_ext" mask="99999" validate="integer" id="company_ext" style="width:36px"  maxlength="5" value="#form.user_ext#"/>
     </td>
    </tr>
  <tr>
    <td colspan="100%"><input name="validateCompany" id="validateCompany" type="checkbox" value="" onclick="validateCompanyInfo()" class="scroll" href="#option3"/> Check this box when finished&nbsp;</td>
    </tr>
</table>
</div><!---END OPTION 2COMPANY--->

<div class="borderBox" id="option5" style="display:none">
<strong>How will you be paying for this transaction?</strong><br />
<br />
<div id="CCOption">
<label>
<input type="radio" name="payType" id="CC" value="CC" <cfif form.payType EQ 'CC'>checked</cfif>/>
</label>
Credit / Debit Card
</div>
<div id="BMOption">
<div id="billMe">
<input type="radio" name="payType" id="I" value="I" <cfif form.payType EQ 'I'>checked</cfif>/>
Bill Me Later( Mail check or or pay by credit card within 30 days. )
</div>
</div>
<br />
<br />
</div>



<cfif Return_Code EQ 'N'>
<br />
<script>
	$(document).ready(function() {
	$('#option4').css('border', '1px solid red');
	$('#option4').css('background-color', '#fcd3c9');
	$('div').show();
	$('html, body').scrollTo('div[id=option4]', 800,  {offset: {top:-80} } );
	});
</script>

<cfoutput>
<div class="borderBox" style="color:red; font-size:14px; font-weight:bold; border:1px solid red">
The following error has occurred: #Card_Response#. Please try again.
</div>
</cfoutput>
</cfif>

<!---OPTION 4---------------------------------------------------------------------------------->
<div id="option4" class="borderBox" style="display:none">
<span class="titles1">Payment Information</span><br />
  <br />
  <table width="100%" border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td colspan="3">The total amount you will be charged is  
      <label>
        $ 
        <cfinput name="AMOUNT" value="#form.amount#" type="text" id="AMOUNT" style="width:48px; text-align:right; background-color:##CDFEBC"  readonly="readonly" /> 
        for 1 year of licensing from today's date.
      </label></td>
    </tr>
  <tr>
    <td width="31%">Name on Card<br />
      <cfinput name="NAME" value="#form.name#" id="NAME" type="text" style="width:200px"/>
      </td>
    <td width="28%">Street Address<br />
      <cfinput type="text" value="#FORM.STREET#" name="STREET" id="STREET" style="width:200px"/></td>
    <td width="41%">&nbsp;</td>
    </tr>
  <tr>
    <td>City<br />
      <cfinput type="text" value="#form.city#" name="CITY" id="CITY" style="width:100px"/></td>
    <td>State<br />
      
      <select name="STATE" id="STATE">
      <cfoutput> <option value="#FORM.STATE#" selected="selected">#FORM.STATE#</option></cfoutput>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        <option value="AR">Arkansas</option>
        <option value="CA">California</option>
        <option value="CO">Colorado</option>
        <option value="CT">Connecticut</option>
        <option value="DE">Delaware</option>
        <option value="DC">District of Columbia</option>
        <option value="FL">Florida</option>
        <option value="GA">Georgia</option>
        <option value="HI">Hawaii</option>
        <option value="ID">Idaho</option>
        <option value="IL">Illinois</option>
        <option value="IN">Indiana</option>
        <option value="IA">Iowa</option>
        <option value="KS">Kansas</option>
        <option value="KY">Kentucky</option>
        <option value="LA">Louisiana</option>
        <option value="ME">Maine</option>
        <option value="MD">Maryland</option>
        <option value="MA">Massachusetts</option>
        <option value="MI">Michigan</option>
        <option value="MN">Minnesota</option>
        <option value="MS">Mississippi</option>
        <option value="MO">Missouri</option>
        <option value="MT">Montana</option>
        <option value="NE">Nebraska</option>
        <option value="NV">Nevada</option>
        <option value="NH">New Hampshire</option>
        <option value="NJ">New Jersey</option>
        <option value="NM">New Mexico</option>
        <option value="NY">New York</option>
        <option value="NC">North Carolina</option>
        <option value="ND">North Dakota</option>
        <option value="OH">Ohio</option>
        <option value="OK">Oklahoma</option>
        <option value="OR">Oregon</option>
        <option value="PA">Pennsylvania</option>
        <option value="RI">Rhode Island</option>
        <option value="SC">South Carolina</option>
        <option value="SD">South Dakota</option>
        <option value="TN">Tennessee</option>
        <option value="TX">Texas</option>
        <option value="UT">Utah</option>
        <option value="VT">Vermont</option>
        <option value="VA">Virginia</option>
        <option value="WA">Washington</option>
        <option value="WV">West Virginia</option>
        <option value="WI">Wisconsin</option>
        <option value="WY">Wyoming</option>
        </select>
      </td>
    <td>Zip Code<br />
      <cfinput type="text" name="ZIP"  id="ZIP" style="width:48px" maxlength="5" value="#form.zip#" mask="99999"/></td>
  </tr>
  <tr>
    <td>
      Card Type<br />
      <cfoutput>
      <select name="CARDTYPE" id="CARDTYPE">
        <option selected="selected" value="#FORM.CARDTYPE#">#FORM.CARDTYPE#</option>
        <option value="Visa">Visa</option>
        <option value="MC">MasterCard</option>
        <option value="Amex">American Express</option>
        </select>
        </cfoutput>
     </td>
    <td>
      Acct Number(no dashes or spaces)<br />
      <cfinput type="text" name="CC_Number" id="CC_Number" style="width:120px"  maxlength="16" mask="9999999999999999" validate="integer" value="#FORM.CC_Number#"/></td>
    <td><span style="float:left; width:auto; height:auto;">
      Expiration<br />
      <cfoutput>
      <select name="MONTH" id="MONTH">
        <option value="#form.MONTH#">#form.MONTH#</option>
        <option value="01">01</option>
        <option value="02">02</option>
        <option value="03">03</option>
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
        <option value="08">08</option>
        <option value="09">09</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        </select>
        </cfoutput>
        <cfoutput>
     <select name="YEAR" id="YEAR">
        <option value="#FORM.year#">#FORM.year#</option>
        <option value="07">2007</option>
        <option value="08">2008</option>
        <option value="09">2009</option>
        <option value="10">2010</option>
        <option value="11">2011</option>
        <option value="12">2012</option>
        <option value="13">2013</option>
        <option value="14">2014</option>
        <option value="15">2015</option>
        <option value="16">2016</option>
        <option value="17">2017</option>
        <option value="18">2018</option>
        </select>
        </cfoutput>
      </span></td>
  </tr>
  <tr>
  <td>
  <input name="validateCC" id="validateCC" type="checkbox" value="" onclick="validateCCInfo()" class="scroll" href="#option6"/>Check this box when finished.
  </td>
  </tr>
</table> 
</div><!---END OPTION 4--->
  
  
  <!---option 6----------------------------------------------------------------------------------------------------->
  <div id="option6" class="borderBox" style="display:none">
  <div style="overflow:auto; width:733px; height:400px; border:1px solid grey; background:#FFC; margin-top:10px; margin-bottom:10px;">
    <p><strong>Terms of Use</strong><br />
      This  Agreement is between Healthgram (&quot;SecureMail&quot;), a division of Primary  PhysicianCare, Inc. and you (&quot;you&quot; or &quot;Customer&quot;), as an  authorized user of SecureMail (&quot;SecureMail&quot; or &quot;the  Service&quot;) and governs the terms and conditions of your use. This  Agreement, together with any operating rules, policies, price schedules, or  other supplemental documents expressly incorporated herein by reference and  published from time to time by SecureMail (collectively, the  &quot;Agreement&quot;), constitutes the entire agreement between SecureMail and  you regarding SecureMail, and supersedes all prior agreements between the  parties regarding the subject matter of this Agreement. Notwithstanding the  foregoing, your use of any software provided by SecureMail related to the  Services shall be pursuant to a separate agreement governing Customers' use of  such software. For purposes of this Agreement, &quot;SecureMail&quot; or  &quot;Services&quot; are defined as any and all services provided by SecureMail  to you either now or in the future. By using SecureMail, you confirm your  acceptance of, and agree to be bound by, this Agreement. <br />
  <strong>Description of Service</strong><br />
      SecureMail  is an Internet-based secure file transfer services and secure data  storage.  The SecureMail service is a  hosted software application.  Licensed  users can use this services to transfer sensitive email content and file  attachments securely.  SecureMail uses  digital certificate encryption technology to secure information transferred to  and from the site. SecureMail offers Services at its website,  securemail.healthgram.com<br />
  <strong><br />
    Free Trial Usage; Fair Use Policy</strong><br />
      SecureMail  provides a free trial as an accommodation to you.  The free trial period lasts for 30 days, and  gives you access to all features of the services for that period.  At the end of the 30 trial, you will be sent  a notification that your trial period has ended, and link to go online to  purchase a valid license.  If you choose  not purchase a license, your account will revert to a &quot;Guest&quot;  status.  &quot;Guest&quot; status means  that the account will remain active, but the &quot;Send&quot; feature of the  service will be disabled.  While in a  Guest status, you may login and access your files, continue to receive files  from other licensed users, but you will not be able to send secure documents  and email using the Service.<br />
      If  you exceed the bandwidth or storage limits of your plan while on your free  trial or if you exceed 10 gigabytes of total storage SecureMail reserves the  right to terminate your free trial before the specified end date or require you  to switch to a paid plan to continue usage of the account. Additionally, if you  or your company has previously created a free trial, you may be required to  convert your free trial to a paid account or your free trial account may be  canceled. Finally, if SecureMail determines that you are using your free trial  in a potentially illegal or unethical way, your free trial may be terminated  without notice. SecureMail also reserves the right to terminate your free trial  for other reasons not outlined above, at the discretion of the company. <br />
      You  will have the option to subscribe for additional services that SecureMail  offers as described on the SecureMail Website, all subject to the terms of this  Agreement or another agreement specific to those additional services. <br />
  <strong>Non-Transferable Membership</strong><br />
      SecureMail  grants you a personal, non-exclusive, non-transferable license to use the  products and software contained in or made available through the Service (the  &quot;Content&quot;) solely for your own internal purposes. All rights not expressly  granted by SecureMail to you are retained. <br />
  <strong>Restrictions</strong><br />
      You  are permitted to store, manipulate, analyze, reformat, print, and display the  Content only for your personal use. Unauthorized use of the Service, or the  resale of the Services without SecureMail's prior written consent, is expressly  prohibited. You shall not copy, license, sell, transfer, transmit, make  available, distribute, publish, or assign this license or the Content in any  format to any third party. <br />
  <strong>Links to Third Party Sites</strong><br />
      SecureMail  does not endorse any sites on the Internet that are linked through the Service.  SecureMail is providing these links to you only as a matter of convenience, and  in no event shall SecureMail be responsible for any content, products, or other  materials on or available from such sites. <br />
  <strong>User Accounts</strong><br />
      A  user account is required to access the Service and may be accessed and used  only by those authorized individuals who are registered with SecureMail. To  open a user account, you or your company must complete the registration process  by providing SecureMail with current, complete and accurate information as  prompted by the registration form. In registering for the Service, you agree to  submit accurate, current and complete information about you and promptly update  such information. Should SecureMail suspect that such information is untrue,  inaccurate, not current or incomplete, SecureMail has the right to suspend or  terminate your usage of the Service. You will choose a personal,  non-transferable password. User accounts cannot be &quot;shared&quot; or used  by more than one individual. <br />
  <strong>User Responsibilities</strong><br />
      You  are also solely responsible for any and all activities that occur under your  account and ensuring that you exit or log-off from your account at the end of  each session of use. You shall notify SecureMail immediately of any  unauthorized use of your password or account or any other breach of security  that is known or suspected by you. You shall also use your best efforts to stop  immediately any copying or distribution of Content that is known or suspected  by you. SecureMail shall not be responsible for any unauthorized access to, or  alteration of, your transmissions or data, any material, information or data  sent or received, regardless of whether the data is actually received by  SecureMail, or any transactions entered into through the Service or failure to  abide by this Agreement. </p>
  </div>
<cfinput name="terms" type="checkbox" value=""/>I have read and agree to the <a href="##" style="text-decoration:none; color:##69F; font-weight:bold">terms and conditions</a> of SecureMail.
     <div style="width:auto; float:right; margin-right:0px;"> <input type="submit" id="submit" onclick="return validateForm();" value="Submit"/></div>
  </div>


</div>
<div style="margin-bottom:50px; clear:both; width:730; height:auto"></div>




</div>
<div style="clear:both"></div> 
</div>
<div class="footer"><a href="login.cfm">Member Login</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="privacy_statement.cfm">Privacy Policy</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="terms.cfm">Terms of use</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="About_us.cfm">About Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="mailto:securemail@healthgram.com">Contact Us</a><br />
<br />
2010 SecureMail. A product of Healthgram 
</div>
</div>

</div>
</cfform>

</body>  
</html>

<html>
<head>
<!---KEEP USER FROM BOOKMARKING PAGES!--->
<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
<cfheader name="expires" value="#now()#">
<cfheader name="pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">

<script>



$(document).ready(function() {
						   					   
						  
	$('#option1').fadeIn('slow');
	//$('html, body').animate({scrollTop:200}, 'slow');
	//$.scrollTop(0);
	//$.animate({scrollTop:'#options1'}, 500);  
	//$.scrollTo('#option4');
});


$(document).ready(function() {
	$('#individual').click(function(){
									
				$('input[name=validateCompany]').attr('checked', false);
				$('input[name=validateUser]').attr('checked', false);
				
				$('#option3').css('display', 'none');
				$('#billMe').css('display', 'none');
				$('#option4').css('display', 'none');
				$('#option5').css('display', 'none');
				$('#option6').css('display', 'none');
									
				$('#option2USER').fadeIn('slow');
				$('#appType').val('individual');
				$('#licenses').val('1');
				
		
		
		});
});


$(document).ready(function() {
	$('#company').click(function(){
								 
				$('#licenses').val('0');
				$('#billMe').css('display', 'block');
								 
				$('input[name=validateCompany]').attr('checked', false);
				$('input[name=validateUser]').attr('checked', false);
								 
				$('#option2COMPANY').css('display', 'none');
				$('#option4').css('display', 'none');
				$('#option5').css('display', 'none');
				$('#option6').css('display', 'none');
									
				$('#option3').fadeIn('slow');
				$('#appType').val('company');
		
		
		});
});


$(document).ready(function() {
	$('#tier').click(function(){
									
				$('#option3').fadeIn('slow');
				$('html, body').scrollTo('div[id=option3]', 800,  {offset: {top:-50} } );
		
		
		});
});

$(document).ready(function() {
	
	$('#CC').click(function(){
				$('#form1').attr('action', 'https://www.securepay.com/secure15/index.cfm');				
				$('#option4').fadeIn('slow');
				$('#option6').css('display', 'none');
				$('html, body').scrollTo('div[id=option5]', 800 );
	
	});
		
});

$(document).ready(function() {
	
	$('#I').click(function(){
						   
					$('#form1').attr('action', 'paymentSuccess.cfm');
					$('#option4').css('display', 'none');
					$('#option6').fadeIn('slow');					
					$('html, body').scrollTo('#option5', 800  );
				});	
	

});

$(document).ready(function() {
	$('#tierCheck').click(function(){
				
									
				if (document.getElementById('total').value != '')
							{
									
				$('#option2COMPANY').fadeIn('slow');
				$('html, body').scrollTo('#option2COMPANY', 800);
							}
							else{
								alert('You must calculate a total of licenses that you would like to purchase!');
								return false;
							}
		
		
		});
});



function validateCCInfo(){
	
	       
			if (document.getElementById('NAME').value == '')
				{
					alert('You must enter the name of the cardholder.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('STREET').value == '')
				{
					alert('You must enter the street address on the credit card account.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('CITY').value == '')
				{
					alert('You must enter the name of the city on the credit card account.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('STATE').value == '')
				{
					alert('You must select a state.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('ZIP').value == '')
				{
					alert('You msut enter a 5 digit zip code.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('CARDTYPE').value == '')
				{
					alert('You must select the type of card you are using.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
				
			else if (document.getElementById('CC_Number').value == '')
				{
					alert('You must enter a valid credit card number.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}				
				
			else if (document.getElementById('MONTH').value == '')
				{
					alert('You must select a month of the expiration date.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
			else if (document.getElementById('YEAR').value == '')
				{
					alert('You must select a year of the expiration date.');
					$('input[name=validateCC]').attr('checked', false);
					return false;
				}
				
			else
			
			{			
			
				$('#option6').fadeIn('slow');
				$('html, body').scrollTo('div[id=option6]', 800,  {offset: {top:-150} } );			
			
				
			}
		
		
	
}



function validateUserInfo(){
	
	if (
		
		 document.getElementById('user_fstnam').value != ''
		&& document.getElementById('user_lstnam').value != ''
		&& document.getElementById('user_address').value != ''
		&& document.getElementById('EMAIL').value != ''
		&& document.getElementById('user_city').value != ''
		&& document.getElementById('user_state').value != ''
		&& document.getElementById('user_zip').value != ''
		&& document.getElementById('user_phone').value != ''
		&& document.getElementById('user_password').value != ''
	)
		{					
 
			isNewEmail()
					
		}
		else
		{
			$('input[name=validateUser]').attr('checked', false);
			alert('You are missing something! Please check all fields and try again!');
	
		}
		
		
		
	
}



function validateCompanyInfo(){

	
	if (1==1
	
		
		&&document.getElementById('company_fstnam').value != ''
		&& document.getElementById('company_lstnam').value != ''
		&& document.getElementById('company_address').value != ''
		&& document.getElementById('company_EMAIL').value != ''
		&& document.getElementById('company_city').value != ''
		&& document.getElementById('company_state').value != ''
		&& document.getElementById('company_zip').value != ''
		&& document.getElementById('company_phone').value != ''
		&& document.getElementById('company_password').value != ''
		&& document.getElementById('company_name').value != ''
		&& document.getElementById('company_title').value != ''
	)
		{
			
			$('#option5').fadeIn('slow');	
			$('html, body').scrollTo('div[id=option5]', 800,  {offset: {top:-200} } );
					
		}
		else
		{
			$('input[name=validateCompany]').attr('checked', false);
			alert('You are missing something! Please check all fields and try again!');
	
		}
		
		
		
	
}




function validateForm(){
			document.getElementById('submit').value='Processing, please wait...';
	
			if (document.getElementById('terms').checked == false)
				{
					document.getElementById('submit').value = 'Submit';
					alert('You must agree to the terms and conditions.');
					return false;
				}
		
			
			else{
				document.getElementById('expDate').value = document.getElementById('MONTH').value + '/' + document.getElementById('YEAR').value;
				document.getElementById('ccNo').value = document.getElementById('CC_Number').value;
				return true;
				}	
	
}





//if (confirm('You have chosen to be invoiced. After completing your account creation, you will be given and option to print an invioce. This must be paid within 30 days to avoid account de-activation. Thank You.'))
</script>


<script>
function calcTotal(){
	
	if ((document.getElementById('licenses').value <= 9) && (document.getElementById('licenses').value > 0)){
	document.getElementById('tier').value = '7.95';
	document.getElementById('total').value = (document.getElementById('licenses').value * 95.00) + '.00'
	document.getElementById('AMOUNT').value = (document.getElementById('licenses').value * 95.00) + '.00'
		}
	else if ((document.getElementById('licenses').value <= 49) && (document.getElementById('licenses').value >= 10)){
	document.getElementById('tier').value = '6.75';
	document.getElementById('total').value = (document.getElementById('licenses').value * 81.00) + '.00'
	document.getElementById('AMOUNT').value = (document.getElementById('licenses').value * 81.00) + '.00'
		}
	else if ((document.getElementById('licenses').value <= 99) && (document.getElementById('licenses').value >= 50)){
	document.getElementById('tier').value = '4.45';
	document.getElementById('total').value = (document.getElementById('licenses').value * 65.00) + '.00'
	document.getElementById('AMOUNT').value = (document.getElementById('licenses').value * 65.00) + '.00'
		}
	else if (document.getElementById('licenses').value >= 100){
	document.getElementById('tier').value = '3.75';
	document.getElementById('total').value = (document.getElementById('licenses').value * 45.00) + '.00'
	document.getElementById('AMOUNT').value = (document.getElementById('licenses').value * 45.00) + '.00'
		}
		
	else if (document.getElementById('licenses').value == 0 || document.getElementById('licenses').value == ''){	
	alert('You must enter a valid number of licenses!');
	document.getElementById('licenses').focus();
		}
	
}
</script>


<!------> 
<script src="js/jquery.scrollTo.js"></script>


<cfif url.trial EQ 'yes'>
	<script>
    $(document).ready(function() {
		$('#option2USER').fadeIn('slow');
    });
	
	function validateUserInfoTrial(){
		
	
	
	if (
		
		 document.getElementById('user_fstnam').value != ''
		&& document.getElementById('user_lstnam').value != ''
		&& document.getElementById('user_address').value != ''
		&& document.getElementById('EMAIL').value != ''
		&& document.getElementById('user_city').value != ''
		&& document.getElementById('user_state').value != ''
		&& document.getElementById('user_zip').value != ''
		&& document.getElementById('user_phone').value != ''
		&& document.getElementById('user_password').value != ''
		
	)
		{
			
			
			isNewEmail2()
			
					
		}
		else
		{

			$('input[name=validateUserTrial]').attr('checked', false);
			alert('You are missing something! Please check all fields and try again!');
	
		}
		
		
		
	
}
    </script>
</cfif>





<cfajaxproxy cfc="checkEmail" jsclassname="myProxy">
<script>
function isNewEmail() {
		var proxy = new myProxy();
		proxy.setCallbackHandler(callbackHandler);
		//proxy.setErrorHandler(errorHandler);
		proxy.setForm('myform');
		proxy.emailChecker(document.getElementById('EMAIL').value);
}     
	
function callbackHandler(res) {
		if (res > 0)
		{
			//alert('this is the isNewEmail 1 check');
			document.getElementById('EMAIL').style.color='red';
			$('input[name=validateUserTrial]').attr('checked', false);
			alert('We are sorry but this email address already exists, please try again.');
			return false
		}
		else
		{ 
			//alert('this is the isNewEmail 1 check');
			document.getElementById('EMAIL').style.color='green'
			$('input[name=validateUserTrial]').attr('checked', true);
			$('#option5').fadeIn('slow');
			$('html, body').scrollTo('div[id=option5]', 800,  {offset: {top:-100} } );
		}
}
	
	
function isNewEmail2() {
		var proxy = new myProxy();
		proxy.setCallbackHandler(callbackHandler2);
		//proxy.setErrorHandler(errorHandler);
		proxy.setForm('myform');
		proxy.emailChecker(document.getElementById('EMAIL').value);
	}     
	
function callbackHandler2(res) {
		if (res > 0)
		{
			//alert('this is the isNewEmail 2 check');
			document.getElementById('EMAIL').style.color='red'
			$('input[name=validateUser]').attr('checked', false);
			alert('We are sorry but this email address already exists, please try again.');
			document.getElementById('EMAIL').focus();
			return false
		}
		else
		{ 
			//alert('this is the isNewEmail 2 check');
			document.getElementById('EMAIL').style.color='green'
			$('input[name=validateUser]').attr('checked', true);
			$('#option6').fadeIn('slow');
			$('html, body').scrollTo('div[id=option6]', 800,  {offset: {top:-100} } );
		}
}
</script>


<cfif isdefined('return_code')>
<cfif form.appType EQ 'company'>
<script>
    $(document).ready(function() {
		$('#option2USER').css('display', 'none');
		$('#IndyCheck').css('display', 'none');
		$('#option6').css('display', 'none');
		$('#option2COMPANY').fadeIn('slow');
		$('#tierCheck').attr('checked', true);
		$('#validateCompany').attr('checked', true);

    });
</script>
<cfelseif form.appType EQ 'individual'>
<script>
    $(document).ready(function() {
		$('#option2COMPANY').css('display', 'none');
		$('#CompanyCheck').css('display', 'none');
		$('#billMe').css('display', 'none');
		$('#option6').css('display', 'none');
		$('#option3').css('display', 'none');
		$('#option2USER').fadeIn('slow');
		$('#validateUser').attr('checked', true);
    });
</script>
</cfif>
</cfif>




</head>
</html>

Open in new window

Not to be too simplistic, but it seems like the issue is what reiter said it was: having multiple fields with the same name in the _same form_.

>>      <input type="text" name="user_fstnam" ..>
>>     <cfinput type="text" name="user_fstnam"  ... />

For example, you've got 2 fields with the name "user_fstnam".  So the 2 values will be contenated as 1:  ie  "Judson,Judson"

As I mentioned in a previous response, If you don't want that to happen, you have to give the fields different names:

         <input type="text" name="user_fstnamPersonalSection" ..>
         <cfinput type="text" name="user_fstnamCreditSection"  ... />
ASKER CERTIFIED SOLUTION
Avatar of reiters
reiters
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so basically with the AJAX approach I should just do the ColdFusion.navigate to the correct form based on when a user clicks on individual or company?

I tend to like that idea because it hides the form that is not needed.

Is this what you mean?

then when the form is submitted, it only sees the form area for demogrpahics that was actually loaded into the div correct?

then when the response comes back invalid I just do a CF.Nav inside of a script depending on what the type was??? Company or individual?

BTW, I am a self taught developer, do you guys feel like this was done sloppy?

J

You can do this without a redirect.  I will explain in a few.  I'm on a conference call.  jQuery.load() is what you want.
While jquery is great. My first thought always tends to be look for the simplest solution ie separate forms ideally.  BUT, I haven't reviewed the code that thoroughly to know if that's the right option here or even a feasible option.  
>> ie separate forms ideally.

Or separate field names. Unless there's a reason you _must_ use the same name for both fields.
so I tried this and its not doing anything! Why???

I made a cfDiv with id of "option2"  and put the user info form on an ajax page.....

$(document).ready(function() {
      $('#individual').click(function(){
                        $("#option2").load("AJAX_userInfo.cfm");      
            });
});


its not working.....
Sorry.  I haven't used ColdFusion's ajax tools in a while.  ColdFusion.navigate IS the one you are looking for if you choose to take that route.

You will need an extra IF statement so that if you are returning to the page that you detect it and pre-populate the div

EX:
<cfparam name="form.firstview" default="1">

<form ...>
<input type="hidden" name="firstview" valuie="0">
...

<div id="user_info_stuff_here">
    <cfif form.firstview eq 0>
        <cfswitch expression="#choice#"> ... </cfswitch></cfif>
    </div>
</form>


That's very pseudo codish, but hopefully you get the idea.
I have changed section one to this:


<!---OPTION 1 SELECT TYPE OF ACCOUNT------------------------------------------------------------------------------------------------------->  
<!---OPTION 1 SELECT TYPE OF ACCOUNT-------------------------------------------------------------------------------------------------------> 
<!---OPTION 1 SELECT TYPE OF ACCOUNT-------------------------------------------------------------------------------------------------------> 
<div id="option1" class="borderBox" style="display:block; background-color:white">
<cfif form.appType NEQ 'trial'>
<span class="titles1"><a name="About">Purchase Options</a></span>
<p>Thank you for your interest in purchasing SecureMail. Please select the appropriate options below based on your individual or company needs.<br />
  <br />
  Which type of license would you like to purchase?
</p>
<p>
  <div id="IndyCheck">
  <label>
  <input type="radio" name="Accttype" id="individual" value="individual" <cfif form.apptype EQ 'individual'>checked</cfif> onclick="ColdFusion.navigate('AJAX_userInfo.cfm', 'option2')"/>
    Individual <span style="color:grey; font-style:italic;">(single license for 7.95 per month*)</span></label>
  <br />
  <br />
  </div>
  <div id="CompanyCheck">
  <input type="radio" name="Accttype" id="company"  value="company"  <cfif form.apptype EQ 'company'>checked</cfif> onclick="ColdFusion.navigate('AJAX_companyInfo.cfm', 'option2')"/>
  Company <span style="color:grey; font-style:italic;">(multiple licenses)</span>
  </div>
  <cfelse>
  <span class="titles1"><a name="About">Free 30 day trial!</a></span>
  <p>
  Please fill out the following information to receive a free 30 day trial of SecureMail!<br />
<span style="color:grey; font-size:11px;">Please note: After the 30 day trial, your account access will be limited to only receiving and replying to SecureMail. <br />
You WILL NOT be able to send messages unless you purchase a license.</span>
  </p>
  </cfif>  
</div>
<!---END OPTION 1-------------------------------------------------------------------------------------------------------->
<!---END OPTION 1-------------------------------------------------------------------------------------------------------->
<!---END OPTION 1-------------------------------------------------------------------------------------------------------->

Open in new window

Looks like that should work.  You will just need the logic to pre-populate the "option2" div if the form has already been submitted.
I am working on all of that now. I separated the 2 forms into their own ajax calls and are  called depending on the users selection. I will post my result tomorrow!
ok, there is a problem.. I made the userinfo page into its own page and load in useing coldfusion.navigate, but when the page loads back, how do I pull the request variables into the CFDIV? iit doesnt see the form variables that are coming back! I thought a CFDIV was seen as part of the page!

I need to load the variables back into the cfdiv so the fields will populate. It works fine if not in a CFDIV.
When you do an ajax call to a page here is whats happening.

1. JavaScript makes a request to the server as if it were a browser.
2. Server returns the result as if it were any visitor to the page.
3. JavaScript stuffs the returned HTML into a javascript variable.
4. JavaScript pushes the HTML contents of that variable into the div container.

Its more clear whats going on when using jQuery.ajax() because CF hides most of the workings making it easier (questionably).

All that was to give you a better understanding of the hidden works...now to the answer.  You need to pass the form field values in the url and handle it on the page being loaded in.

ColdFusion.navigate('foo.cfm?field1=#this#&field2=#that#' , 'div_container')

The adobe docs suggest you can do something like this

ColdFusion.navigate('foo.cfm' ,'div_container', function(){}, function(){}, 'post', 'form_name_or_id_here'])

I have never tried the second method but it allows you to "post" the entire form structure which saves you some labor and eliminates "get" limitations.

Here are adobe's docs on it.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=JavaScriptFcns_24.html

If you choose to pass the values in the URL you might want to wrap any string values in #urlencodedformat(value_here)#.
the problem with posting the form variables in the second example is that because they are in the cfdiv they arent existent yet.

Just send them in the URL or send some DB key so you can get the values from the DB on the ajaxed page.  Depends on what you are doing with it.
If they have already submitted and made mistakes then your wouldn't need to ajax the content into that div.  You would already know the users choice at page load time.
ok as a test i did this:

<input type="radio" name="Accttype" id="individual" value="individual" <cfif form.apptype EQ 'individual'>checked</cfif> onclick="ColdFusion.navigate('AJAX_userInfo.cfm?fstnam=test', 'option2')"/>

when the ajax page loads I did a CFDump on URL and is show that the struct is empty! Why????
disregard the last post
I changed my radio button to this:
<input type="radio" name="Accttype" id="individual" value="individual" <cfif form.apptype EQ 'individual'>checked</cfif> onclick="ColdFusion.navigate('AJAX_userInfo.cfm?fstnam=#form.fstnam#&lstnam=#form.lstnam#&address=#form.address#&address2=#form.address2#&user_city=#form.user_city#&user_state=#form.user_state#&user_zip=#form.user_zip#&phone=#form.phone#&ext=#form.ext#&email=#form.email#&password=#form.password#', 'option2')"/>

I am getting errors the fstnam is undefined in url, etc on the ajax page
Try <cfdump var=#url#> and <cfdump var=#attributes#> on the ajaxed page just to see what is coming accoss.  Comment all other code.  If you are using a framework like fusebox then you may have to make some adjustments.