• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Getting changed data-value in Controller

MOZ

Well-known member
#1
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)
 

digitalpoint

Well-known member
#3
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?
 

MOZ

Well-known member
#9
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.
 

MOZ

Well-known member
#12
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.
 
S

Syndol

Guest
#13
Ah, I misunderstood you.
I tried what you described and could not get it to work either. Sorry.