close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to validate against duplicate email address

Thread began 3/13/2011 6:28 pm by YellowCircleWeb | Last modified 4/04/2012 10:14 am by Jason Byrnes | 10506 views | 18 replies |

YellowCircleWeb

How to validate against duplicate email address

Hi,

I've searched the forums and found postings relating to using validation toolkit to check for duplicate email addresses in a database before adding a new record but I don't fully understand how to get it to work and I was hoping someone could explain it more clearly for me? I've listed the exact steps I need to create below.

1) Check the email address a user enters into a registration form against records in a database

2) If the email address is found in the database then the record is not inserted, instead a message is displayed stating that the email address is already registered

3) If the email address is not found then the record should be inserted into the database.

I know I need to create a recordset that is filtered by email address (check the database values against the value entered into the email field on the form), but I don't know how to specify the validation rule correctly - do I use Like Entry??

Also I should point out that I'm not using DataAssist to generate the insert record code - instead I'm just using Dreamweaver's built-in Insert Record behaviour.

Any help is appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

First, you need to create the recordset to filter the email address column on the email address form element.

the recordset will create a variable named:
$totalRows_RecordsetName

(where RecordsetName is the name of the recordset) with the number of records returned.

the idea is to use numeric validation to make sure that recordset does not return any records (is empty)

add server validation, chose numeric validation and set the server variable to:
$totalRows_RecordsetName

Set the minimum number to -1 and the maximum number to 0.


to show the error message, use the validation show if behavior.

Sign in to reply to this post

YellowCircleWeb

Thank you Jason, I will give it a go.

[Update] This is now working perfectly. Thank you for your very clear instructions Jason. Much appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

YellowCircleWeb

Hi again,

I've moved my page over to a different server and now the validation isn't working. It states a duplicate email address is found even when one isn't. I've followed the instructions Jason posted earlier about 30 times and I just cannot see what I'm doing wrong or why it's not working.

If I remove the validation then the details entered in the form are added to my database, if I include the validation then they are never added, even when a completely new email address is used.

I've attached a the page as a zip file - any help is very much appreciated.

Attached Files
website-hosting-competition.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem was caused by the order of the code.

the code to create the recordset was after the code to perform the validation.

I am attaching an updated copy of the page with the code rearranged.

Attached Files
website-hosting-competition.php.zip
Sign in to reply to this post

YellowCircleWeb

Brilliant! Thank you very much for your help Jason. It works perfectly now. I tried re-ordering the code myself before updating this thread and I couldn't get it to work. I'll use your version of the file as a reference in the future.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

cherry8723424721

Email Duplicate Verification

Hi Jason:

I was reading your instructions on how to validate against email addresses. Your instructions look quite clear, except that when you say "add server validation, chose numeric validation and set the server variable to: $totalRows_RecordsetName" I don't know how to "add server validation".

Could you kindly explain a bit further? Just in case, attached you will find the "Enter Profile" page where I would like to add the email validation.

Thank you for your attention.

Attached Files
CherryEnterProfile.zip
Sign in to reply to this post

Jason ByrnesWebAssist

to add server validation, you need to add the Server Validation server behavior.

The steps for this depend on what tools you have installed.

if you have Validation Toolkit installed, go to Insert -> WebAssist -> Validation Toolkit -> Server Validation.


if you have either Form Toolkit or CSS Form Builder, Go to Webassist -> Forms -> Validation -> Server Validation

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...