Hello,
I am having a problem populating the value of file input for a resource,
when a user revisit the resource. I am using revo 2.0.6.
I have a custom TV Output Type for a file. I use a template like the one below.
<input type="file" id="tv{$tv->id}" name="tv{$tv->id}" />
I have a plugin which then copies the file to a separate folder.
Is there anyway to populate a hidden field so that the value isn’t lost when
any change is made to the resource. Whenever a user makes a single change
to the resource it loses the value for the file.
Any help would be greatly appreciated.
Thanks,
Bart
-
☆ A M B ☆
- 3,141 Posts
I assume there’s a snippet on your resource (formit, or something custom made) that is capable of setting placeholders. You could then set the [[+tvname]] placeholder with the file location/name and call it in [q]value="[[+tvname]]"[/q]
When you’d do that, though, and submit the form, it will most likely attempt to upload a file from the users’ computer (which doesn’t exist), so I would just keep the file upload field empty, but instead display something like "Current file: [[+tvname]]" and using the field to upload a new one to replace it.