Appending ID to file upload many on my images
Appending ID to file upload many on my images
I am trying to append an ID to an array that gets submitted to my server side script. Basically, I change one of many images on my edit, then when that happens it goes to my script which receives a POST array with the name for the file upload many as follows.
I see this in my network tab on my developer tools.
array(2) {
["action"]=>
string(6) "upload"
["uploadField"]=>
string(9) "secondary"
}
How do I append the id of the actual row to this array?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Here is the code for my editor.
The reason that the row id isn't sent is that you can upload an image in the create action. At that point the row doesn't have an id since it doesn't exist in the database at that time.
You could use the
ajaxData
option of theupload
field type to add the row id, but as I say, that will only work for an edit, not a create.Allan
Thanks for the tip allan! I found a working example of how to get this to work.
How you would do it is as follows.