I tried to look around, but didn't exactly found what I was looking for. Joomla have documentation about how to create custom form fields. That was useful, but what I need is (I guess simple..?).

I want to have custom form field for backend component. Just a simple input text field with two options - add/delete. When you press add I get additional text field, if I want to delete - it simply removes. I want to understand how to do this. Thank you!

  • 2
    You could always wait until Joomla 3.7 when custom form fields will be shipped with core. – Lodder Mar 23 '17 at 17:23
  • @Lodder When will Joomla 3.7 be launched? I am already using 3.7 beta version. – Poo123 Mar 24 '17 at 8:06
  • Not sure, there's still a lot of working happening on custom fields – Lodder Mar 24 '17 at 10:14

I am using the following to achieve something similar to what you need BUT in a plugin. Need to confirm if it is also valid to component.

                <option value="add">add</option>
                <option value="delete">delete</option>
                filter="string" />

The use of showon let you conditionally show the field. Hope it helps.

| improve this answer | |
  • Can you please give me full example? File name/location/calling it ect. ? Thanks in advance @n.h. – Poo123 Mar 23 '17 at 14:28
  • Use it in the manifest xml file. See – n.h. Mar 23 '17 at 14:48
  • @Poo123 More details about it here – n.h. Mar 28 '17 at 9:12

From my experience. onshow ONLY works if you use renderFieldSet if you use renderField it won't work. it seems that the whole fieldset needs to be shown at the same time so that JForm can link the fields.

Content transferred from deleted answer (deleted via moderation) by @robjoyce:

Correction to my previous:
renderField works too. It's when you use the label and value separately that it will break.

[grammar/formatting improved by @mickmackusa]

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.