Getting changed data-value in Controller

MOZ

Well-known member
I am working on a addon that deals with attachments. I have a checkbox and to pass its checked state, this is what I am doing:

Using JS onClick, I change the data-value of a HiddeInput in the attachment_upload_button template.
The data-value of this HiddenInput is read by the XenForo_ControllerPublic_Attachment::actionDoUpload and then further action is taken.

The issue is that data-value is successfully changed (Check by sending alert onClick with value of data-value) however this change is not reflected in the actionDoUpload function (Checked by dumping the value read by the controller)
 
The attachment upload button is really a Flash object that reads those settings when it inits. It doesn't go back and read them if you change them after it inits. Or am I not understanding what you are trying to do?
 
Ah, OK. So I could go about reloading the flash object only when the checkbox state is changed?
 
I was able to reload the button with the new parameters for SWFUlpoad (The flash based upload that XF uses), however unlike normal SWFUpload, here the parameters are passed as span attributes, so anyone know how to send these as parameters for the button.
 
What's the importance of using the button? Why can't you just use the form?
 
The motive is to pass an additional parameter to the attachment uploader however this additional parameter may be toggled by the user at the time of the attachment.
 
Ah, I misunderstood you.
I tried what you described and could not get it to work either. Sorry.
 
Top Bottom