I created a frontend override of com_content/views/form/tmpl/edit.php and added a plain ol' HTML input field within the <form> as below:

<input type="text" name="jform[attribs][vidurl]" value="" id="jform_attribs_vidurl" />

I expected the data to be saved in the _content/attribs table but it just returns null as if the name is not passed during POST.

It worked properly for the image field

I did the same for the image_intro field and that value saves correctly.

I deleted line

<?php echo $this->form->renderField('image_intro', 'images'); ?>

and used

<input type="hidden" name="jform[images][image_intro]" id="jform_images_image_intro" value="" />

Then pass the image path value from a AJAX process after successful upload via file input field, to the hidden image field via javascript. The data saves successfully on submit.

Is it that there must be an existing XML string with the field attributes?

Does JFORM ignore HTML fields if its attributes are not found in a xml string? How can I get a custom added field to save?

The custom form output

joomla custom frontend article submission form

0

There are 0 best solutions below