File chooser in a list
Permalink
I tried to use the file method of concrete/asset_library to build a list of files.
What I wanted to achieve was a list of hidden input tags that generate an array:
but it seems like the file method:
can't be used for this because it appends "value" to the name of the input field and makes it therefore impossible to use in a list.
I found a few ways around that but thought it might be nice to have a simple method for this?
What I wanted to achieve was a list of hidden input tags that generate an array:
<input type="hidden" name="myFiles[]"../>
but it seems like the file method:
<?=$al->file('ccm-b-file', 'fID', t('Choose File'), $bf);?>
can't be used for this because it appends "value" to the name of the input field and makes it therefore impossible to use in a list.
I found a few ways around that but thought it might be nice to have a simple method for this?
can u please let us know what you have discovered...
ah, well the way I did this one is that i simply went ahead and knowing the format i would be looking for in the post array basically just image[56] or whatever, then i simply went ahead and iterated the count of the post array looking for applicable added asset library choosers.
I know there is other stuff in the post array, but by using the count of the post array, i ensured that i had every possible asset_library selection captured at the cost of maybe a few iterations/checks of in_array for something that couldn't possibly exist since the post array is more than just images, the trade off was worth it to me as it really isn't a big deal :)
-Scott
I know there is other stuff in the post array, but by using the count of the post array, i ensured that i had every possible asset_library selection captured at the cost of maybe a few iterations/checks of in_array for something that couldn't possibly exist since the post array is more than just images, the trade off was worth it to me as it really isn't a big deal :)
-Scott
Did you work out how to select multiple files using the File Chooser?
Im struggling to select more then one image
Im struggling to select more then one image