Forums

Validate existing database records

Joomla-Newbies 26 Sep, 2011
Hi all.

I have a customer registration form up and running. I want to prevent existing user from inserting new records instead it should only update the already existing records. That is allow them to complete the form as normal, once they hit the submit button, the code should check if the same first name and last name is already in the database if yes then it should update their records and if not it should insert new record to the table.

I do not want to alert the customer that their records already exist.

Thank you for your time.
GreyHead 26 Sep, 2011
Hi Joomla-Newbies,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6.

Bob
Joomla-Newbies 26 Sep, 2011
Many thanks for your response. The version is V4 RC2.0
GreyHead 26 Sep, 2011
Hi Joomla-Newbies,

The best place to do this after the form is submitted is to use the Custom Serverside validation action and add code in there to check the submitted value in the database table.

A more elegant way to do this is to use Ajax to check the registration in the form before it is submitted. I have a CFv3/4 tuturial on this that you can buy here if you are interested.

Bob
This topic is locked and no more replies can be posted.