Custom Registration Form with additional fields

chronouser84 08 Aug, 2014
Hi All,

I gather this is a common functionality that would be needed by many Joomla/Chronoforms users, but I can't seem to find a solution on the web. So I've resorted to posting my question here in hope that someone can provide a solution or point me in the right direction.

So far I've managed to create a form that replaces the Joomla registration form. However, I need to create 2 class of users - a customer user and a business user. I want the user to register using the joomla existing fields (name, username, email, password), but I also want to write additional information to 2 other tables during the registration process. The customer table will have additional fields - eg customer type, customer gender, customer_stats etc. The business table will have rego_number, business_info etc.

Chronoforms seem to only allow me to write to one single table. But I want to write to 3 tables: jos_users, jos_customers, jos_business.

How do I go about achieving this?
GreyHead 08 Aug, 2014
Hi chronouser84,

You can use more than one DB Save action in your form On Submit event to save to more than one table. You just need to take care to match up the names in the $form->data array with the column names in the respective tables.

Bob
chronouser84 08 Aug, 2014
Thanks for the reply Bob.

I'm new to Chronoforms so this may be a stupid question. Can I use the "Handle Arrays" action to implode the $form->data that I need then save to one table? Afterwards, can I then re-use the "Handle Arrays" action again to save to another table and so forth? In essence, can I do the following:

On Submit:
Handle Arrays (field_name1, fieldname2)
DB Save to table1
Handle Arrays (field_name3, fieldname4)
DB Save to table2
Handle Arrays (field_name5, fieldname6)
DB Save to table3

Maybe you're referring to the use of a "Custom PHP" action before each "DB Save" action?
GreyHead 09 Aug, 2014
Hi chronouser84,

I'm not sure that I understand the question but I'm pretty sure that the answer is 'No', that won't help. The Handle Arrays action is used to convert array results from your form submission into comma separated strings.

Provided that the tables don't use the same column name for different data this should just work.

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