Validate data before uploading async

3 posts, 0 answers
  1. Alex
    Alex avatar
    21 posts
    Member since:
    May 2013

    Posted 21 Jul 2015 Link to this post


    I try to use the upload widget in async mode to present a progress bar.

    I add a bunch of form data within the upload event which works fine. Now I would like to validate the form data before uploading the file. If I do this in the upload event as well and set e.preventDefault() if validation fails, the list of selected files is cleared in the upload widget which doesn't make sense in this scenario as the customer is forced to correct the form data AND select the images again.

    Is there a way to validate data before uploading a file without loosing the list of selected files?




    Alex Bernhard


  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2127 posts

    Posted 22 Jul 2015 Link to this post

    Hello Alex,

    The current behavior is by design - if the upload event is prevented, the list files is cleared. I would suggest to reconsider the approach and validate the rest of the form data earlier.

    Dimiter Madjarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Alex
    Alex avatar
    21 posts
    Member since:
    May 2013

    Posted 22 Jul 2015 in reply to Dimiter Madjarov Link to this post


    thank you for your reply. That's what I expected. I solved the problem by validation in the select event. It is not completely intuitive as the customers cannot select an image before having filled all form values correctly. Its much more common that validation occurs on blur or when trying to send the form / upload the image but it works.

    Thank you very much for your support.

Back to Top