Within my Joomla 3.3 form, I have integrated an ajax script aimed at dynamically updating some form fields. The core of the script looks like this:
formdata = new FormData();
jQuery.ajax({
type: "POST",
dataType: "json",
timeout: 6000,
url: "index.php?option=com_mycomponent&task=component.save",
data: formdata,
......................
........
Upon executing the ajax script, I encountered a scenario where $_POST appears to be entirely empty within the controller, therefore hindering my access to crucial formdata.
I did attempt various strategies, such as:
formdata = new FormData($(this)[0]); => no visible impact
or
formdata = new FormData();
formdata = $(this)[0]; => no noticeable effect
or
formdata = new FormData();
form = $(this)[0];
formdata.append("jform", form) => while this populates my $_POST, the value is still undefined
The question remains: How can I effectively transfer my formdata (specifically the jform object) to the controller through the use of Ajax POST method?