Forum Moderators: coopster

Message Too Old, No Replies

Field validation.on a different basis.

         

tonynoriega

5:38 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a registration form that my agnets enter leads into...
pretty simple, about 50 fields that get stored in MySQl dbase...

Is there a javascript that will alert my agents when they enter a duplicate name that is already in the database?

Im not sure if that is a jscript, or some sort of query line that would be attached to that specific form field to verify names...

does anyone have an idea?
(sorry if this is the wrong area for this thread)

justgowithit

6:39 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



I would write a function that checks the name field for duplicates prior to your main insert query. It would be easy enough to do with PHP/MySQL.

One thing to consider is that you may be wasting your time. Names are an inconstant value subject to human interpretation. Checking your database for a name that may have been duplicated by more than one agent may or may not produce the desired results.

Like:

Agent #1 enters - Joe Smith
Agent #2 enters - Joseph Smith
Agent #3 enters - Joseph L. Smith
...etc., etc.

You may be better off checking dups on a more consistent value like an email or a phone number.

dreamcatcher

7:13 am on Aug 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Best to set the username field to UNIQUE. Then check if the query is failing. If its failing its a duplicate name.

dc

justgowithit

1:28 pm on Aug 3, 2007 (gmt 0)

10+ Year Member



Best to set the username field to UNIQUE.

It sounds like he's having multiple reps submit raw lead data into the db via the same form.

Do you think there's a need for the rep to create a username for each submission? I don't think the subject of the lead ever sees the site.

I was suggesting checking on a phone or email because they are less subject to interpretation. I guess even that is not full-proof, though.