Git Product home page Git Product logo

Comments (9)

skydiver avatar skydiver commented on July 22, 2024

Not sure if there is possible right now (i will take a look).

Maybe is time to start thinking on another upload component...

from october-plugin-forms.

jaycbrf4 avatar jaycbrf4 commented on July 22, 2024

http://blueimp.github.io/jQuery-File-Upload/index.html

from october-plugin-forms.

Zmove avatar Zmove commented on July 22, 2024

+1 for the plugin linked above. Very good plugin that may help for a better integration of upload system to magicform.

Edit, here is a link from the plugin documentation :

https://github.com/blueimp/jQuery-File-Upload/wiki/Multiple-File-Input-Fields-in-One-Form

It can manage multiple upload widget in one form out of the box. It's a good start to make the upload field to works like the others fields.

from october-plugin-forms.

 avatar commented on July 22, 2024

Hello,

Any update with this ? I don't have enought october cms skill (yet) to help, but the jquery file upload solution linked above could be a very good solution.

from october-plugin-forms.

skydiver avatar skydiver commented on July 22, 2024

Hello @Alex360hd, i made a few test some time ago (unfortunately don't have to much free time).

Using the plugin it's easy, the difficult part is the integration with October attachments and saving the files before submit the form.

The current upload was easy because there was already a plugin doing all this task.

I'm interested on this issue, but as i say, don't have free time right now 😞

from october-plugin-forms.

Zmove avatar Zmove commented on July 22, 2024

Hello,

Do you have an edge version of the module with the integration with the jquery file upload plugin ? To clearly see what's missing with october attachments to make it works.

from october-plugin-forms.

skydiver avatar skydiver commented on July 22, 2024

@Zmove don't have any code, i've deleted my tests because was useless, sorry

from october-plugin-forms.

TonnnnUK avatar TonnnnUK commented on July 22, 2024

For anyone coming across this issue a hacky way around this I have implemented is by adding a session within the checkUploadAction function in ComponentUtils.php in the traits folder. This triggers and adds the session when a file is uploaded.

Within MagicForm.php in the onFormSubmit method check if _uploader is set. If isset then check for the file uploaded session created above. If it's not found add to the $rules and $msgs variables to output the validation message.

If you may multiple forms and some might not require the file upload you may need to add a hidden field which can be checked if isset along with the _uploader field.

Finally add the Session::forget() method when the record is saved to the database and within the onRemoveAttachment method in the fileuploader.php file (incase a user removes the file and forgets to add another).

Hope this helps.

from october-plugin-forms.

afdstudio avatar afdstudio commented on July 22, 2024

Hi! I saw this post and I have the same need...
How can I make file upload required on a Form within magic forms plugin?
Any help will be very welcome!

@TonnnnUK gave a great solution but I don't know how to implement...

If anyone have a simplest way, it will be fine!
Thank you in advance!

from october-plugin-forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.