Add field in custom component by click

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
voron121
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Oct 31, 2022 6:27 pm

Add field in custom component by click

Post by voron121 » Mon Oct 31, 2022 6:35 pm

Hi! Sorry, maybe it's offtop, but i can't find topic with my peoblem.
So, i try create custoom component for admin panel. On edite page for item i want add fields (input for string data) when user click on button. User cliked - added new field. And when we save the item in db table all this fields shud be saved like json.

I can't find any examples or articles in oficial documentations about this (i know how render field from xml for component but huw add this field by mouse click no).

Can somebody help me ? Any informations ?

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

Re: Add field in custom component by click

Post by pe7er » Tue Nov 01, 2022 8:35 am

Welcome to Joomla forum!

You can find some coding examples for saving forms here:
https://docs.joomla.org/Basic_form_guide

To save an array of strings into one fields as json, you could use json_encode to convert the array to json.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Locked

Return to “Joomla! 3.x Coding”