Create form with field (db) and save to database table

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
alicealicia
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jun 29, 2020 12:24 pm

Create form with field (db) and save to database table

Post by alicealicia » Mon Jun 29, 2020 12:30 pm

Hello,

I want to create a form, for example registration form with the fields that I want to put in, and the fields in the form to have the fields created in a table in database, and then when user save the record, the record for the form will be save to the table.

Can I know how can I do that?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12771
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Create form with field (db) and save to database table

Post by toivo » Mon Jun 29, 2020 12:36 pm

Welcome to the forum!

For simple forms and even for more advanced forms can go to the Joomla Extensions Directory (JED) and check the free and paid third party extensions in the Forms section.

If you want to customise the Joomla login form, use component and module overrides, explained in the Joomla documentation.
Toivo Talikka, Global Moderator

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 22799
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Create form with field (db) and save to database table

Post by pe7er » Mon Jun 29, 2020 12:38 pm

There are a lot of non-core Form extensions that offer that functionality: https://extensions.joomla.org/tags/forms/

I use RSFormPro (paid version) to create forms. The input is saved in the database, the admins get a notification. Admins have an option to export the data to CSV or a spreadsheet.
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Nederland
Co-developer of d2 Content https://data2site.com/joomla-extensions/d2-content

alicealicia
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jun 29, 2020 12:24 pm

Re: Create form with field (db) and save to database table

Post by alicealicia » Tue Jun 30, 2020 12:02 am

Hello,

Is there possibility that I amend the page with php coding? For example I use the existing form like Contact Us, and I add in the field using the coding, and also create the field in table.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12771
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Create form with field (db) and save to database table

Post by toivo » Tue Jun 30, 2020 12:44 am

Yes, there is. Custom fields offer plenty of possibilities: Adding custom fields

Forms like registration can be overridden by PHP custom code. The benefit of using overrides rather than modifying the Joomla core is that the customised code will not get replaced in the next version update of Joomla. Here are the tutorials:
How to override output from the Joomla! core
Creating Overrides in Template Manager
Toivo Talikka, Global Moderator

alicealicia
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jun 29, 2020 12:24 pm

Re: Create form with field (db) and save to database table

Post by alicealicia » Sun Sep 06, 2020 3:30 am

toivo wrote:
Tue Jun 30, 2020 12:44 am
Yes, there is. Custom fields offer plenty of possibilities: Adding custom fields

Forms like registration can be overridden by PHP custom code. The benefit of using overrides rather than modifying the Joomla core is that the customised code will not get replaced in the next version update of Joomla. Here are the tutorials:
How to override output from the Joomla! core
Creating Overrides in Template Manager
I want to customize the existing registration form, any guidelines or steps for me to follow?

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 6096
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Create form with field (db) and save to database table

Post by AMurray » Sun Sep 06, 2020 5:11 am

You should use (content) overrides. It's not advisable to edit the original core extension code (as your changes will be overwritten the next time Joomla gets updated; overrides will ensure your changes are not overwritten with any future Joomla core update. See below for information:

https://docs.joomla.org/How_to_override ... omla!_core

https://docs.joomla.org/Portal:Component_Development

I'm sure there's more document references, but the above should get you started. Search https://docs.joomla.org for anything else.

Easier way as already mentioned is to use custom fields, that can be added to the Registration form.

You can also re-label all the other existing extra fields for user registration (like address, phone and all that stuff), all you need to do is re-name the fields through language overrides.
Regards,
--------------------------------------------------------------
A Murray
Help you I can, yes!. Post your question, you should. Keep it on topic you must!
Use the Forc....Forum Post Assistant my young Padawan!

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27200
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Create form with field (db) and save to database table

Post by Per Yngve Berg » Sun Sep 06, 2020 6:16 am

Write a User Profile Plugin or use Custom Fields.


Post Reply

Return to “General Questions/New to Joomla! 3.x”