1 Replies - 1304 Views - Last Post: 20 April 2009 - 07:59 PM Rate Topic: -----

#1 cumupkid   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 63
  • Joined: 22-January 08

2ND POST ON THIS TOPIC...Need to query a database to see if email addr

Post icon  Posted 20 April 2009 - 07:57 PM

I have a form that customers fill out, and I need the form to query the data source and look to see if the email address already exists, and if it does I then need to let the customer know their email address alredy exists.

Form code

<cfif isdefined("form.firstname")>

	<cfif form.email eq form.emailverify>
	component="cfcs.customers" method="insertcustomer">
	<cfinvokeargument name="formdata" value="#form#"/>
<cflocation url="index.cfm?thankyou" addtoken="no">
		<cfset errormessage = "Your email address did not match">


<cfparam name="form.firstname" default="">
<cfparam name="form.lastname" default="">
<cfparam name="form.email" default="">

<cfparam name="form.primaryphone" default="">
<cfparam name="form.secondaryphone" default="">
<cfparam name="form.address" default="">
<cfparam name="form.city" default="">
<cfparam name="form.state" default="">
<cfparam name="form.postalcode" default="">

<h2>Join our email list</h2>
<div id="DBTable">
<table border="0" cellspacing="0" cellpadding="2" align="center">

		<td>*First Name:</td>
		<td><cfinput type="text" name="firstname" value="#form.firstname#" required="yes" id="firstname" tabindex="1" maxlength="20"></td>
		<td>*Last Name:</td>
		<td ><cfinput type="text" name="lastname" value="#form.lastname#" required="yes" id="lastname" tabindex="2" maxlength="20"></td>
		<td ><cfinput type="text" name="email" value="#form.email#" validateat="onsubmit" validate="email" required="yes" id="email" tabindex="3" maxlength="50"></td>
			<cfif isDefined('errormessage')><div id="errorMessage">*Verify Email:</div>
			<cfelse>*Verify Email:</cfif>
		<td ><cfinput type="text" name="emailverify"  required="yes" id="emailverify" tabindex="4" maxlength="50"></td>
		<td>*Primary Phone:</td>
		<td ><cfinput type="text" name="primaryphone" value="#form.primaryphone#" validateat="onsubmit" validate="telephone" required="yes" id="primaryphone" tabindex="4" maxlength="12" typeahead="no" showautosuggestloadingicon="true"></td>
		<td>Secondary Phone:</td>
		<td><cfinput type="text" name="secondaryphone" value="#form.secondaryphone#" id="secondaryphone" tabindex="5" maxlength="12"></td>
		<td ><cfinput type="text" name="address" value="#form.address#" id="address" tabindex="6" maxlength="50"></td>
		<td ><cfinput type="text" name="city" value="#form.city#" id="city" tabindex="7" maxlength="20"></td>
		<td ><cfselect name="State" id="State" tabindex="8" selected="#form.state#">
					<option value=" " selected="selected"> </option>
					<option value="AK">AK</option>
					<option value="AL">AL</option>
					<option value="AR">AR</option>
					<option value="AZ">AZ</option>
					<option value="CA">CA</option>
					<option value="CO">CO</option>
					<option value="CT">CT</option>
					<option value="DC">DC</option>
					<option value="DE">DE</option>
					<option value="FL">FL</option>
					<option value="GA">GA</option>
					<option value="HI">HI</option>
					<option value="IA">IA</option>
					<option value="ID">ID</option>
					<option value="IL">IL</option>
					<option value="IN">IN</option>
					<option value="KS">KS</option>
					<option value="KY">KY</option>
					<option value="LA">LA</option>
					<option value="MA">MA</option>
					<option value="MD">MD</option>
					<option value="ME">ME</option>
					<option value="MI">MI</option>
					<option value="MN">MN</option>
					<option value="MO">MO</option>
					<option value="MS">MS</option>
					<option value="MT">MT</option>
					<option value="NC">NC</option>
					<option value="ND">ND</option>
					<option value="NE">NE</option>
					<option value="NH">NH</option>
					<option value="NJ">NJ</option>
					<option value="NM">NM</option>
					<option value="NV">NV</option>
					<option value="NY">NY</option>
					<option value="OH">OH</option>
					<option value="OK">OK</option>
					<option value="OR">OR</option>
					<option value="PA">PA</option>
					<option value="PR">PR</option>
					<option value="RI">RI</option>
					<option value="SC">SC</option>
					<option value="SD">SC</option>
					<option value="TN">TN</option>
					<option value="TX">TX</option>
					<option value="UT">UT</option>
					<option value="VA">VA</option>
					<option value="VT">VT</option>
					<option value="WA">WA</option>
					<option value="WI">WI</option>
					<option value="WV">WV</option>
					<option value="WY">WY</option>
		<td ><cfinput type="text" name="postalcode" value="#form.postalcode#" validateat="onsubmit" validate="zipcode" id="postalcode" tabindex="9" maxlength="5"></td>
		<td>&nbsp; </td>
		<td>&nbsp; </td>
		<td><div align="right"><cfinput type="submit" name="Submit" value="Submit" id="Submit" tabindex="10"></div></td>
		<td ><cfinput type="button" name="cancel" id="Reset" value="Cancel" onclick="history.back()" tabindex="11"></td>

Is This A Good Question/Topic? 0
  • +

Replies To: 2ND POST ON THIS TOPIC...Need to query a database to see if email addr

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,443
  • Joined: 10-May 07

Re: 2ND POST ON THIS TOPIC...Need to query a database to see if email addr

Posted 20 April 2009 - 07:59 PM

I apologize that no one has been able to help you with this yet. However that doesn't mean that you can (or should) open a 2nd topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1