Home › Forums › JavaScript › HTML Progress bar
- This topic is empty.
-
AuthorPosts
-
August 12, 2013 at 1:49 am #146479kanshul2013Participant
I have an html page where user fills in a form, attaches a file and submits the form. The file attached could be quite big, say 300MB in size, so I need to show a progress bar to the user while the submission is in progress.
I’m not able to figure out where to put the html5 progress tag tag so that it shows after the form is submitted and disappears when a response is returned.
<form name="import_form" action='<%= request.getParameter("url") %>/upload_archive' method="post" enctype="multipart/form-data"> <input type="text" name="engagement" value='<%= engagement %>' /> <br/> <input type="text" name="package_reference" /> <br/> <input type="text" name="package_desc" /><br/> <input type="text" name="issue_reason" value='<%= issue_reason %>' /><br/> <label class="label-style">Please select the documents to import : </label> <label class="label-style">Select zip file :</label> <label class="cabinet"><input type="file" class="file" name="zip_file_import" /></label> <label class="label-style">Select manifest file :</label> <label class="cabinet"><input type="file" class="file" name="manifest_file_import" /> <input type="submit" value="Upload" class="button-style" /> </form> <progress max="100" value="60"> </progress>
August 12, 2013 at 2:32 am #146485kanshul2013ParticipantThe idea is that user should have some way to know that operation is in progress and should not be in under an impression that nothing is happening. So, even if it’s not a progress bar but something else like a cursor change etc., that should do as well.
August 12, 2013 at 3:25 am #146490Paulie_DMemberYou’re going to need a JS solution similar to a loading graphic.
https://css-tricks.com/snippets/jquery/display-loading-graphic-until-page-fully-loaded/
August 12, 2013 at 7:01 am #146507kanshul2013ParticipantIs a more straight forward solution possible?
I added the below Javascript function
<script> function formSubmit() { document.getElementById("import_form").submit(); document.body.style.cursor = "crosshair"; } </script>
and in HTML
<input type="button" value="Upload" onclick="formSubmit()" class="button-style" />
This works fine but the only problem is that cursor change is not very prominent to the user. Is it possible to make it bit more prominent, like having a red color circle going round etc. without adding too much complexity.
August 12, 2013 at 7:07 am #146509Paulie_DMemberIs it possible to make it bit more prominent, like having a red color circle going round etc. without adding too much complexity.
Are you talking about a custom cursor?
What about
cursor: wait
orcursor:progress
?Have you abandoned the idea of a progress bar?
August 12, 2013 at 8:09 am #146519kanshul2013ParticipantI have already tried cursor: wait or cursor:progress but it is not prominent enough for the user.
Need something a bit more prominent. I would like to keep it simple, it’s ok if it’s not a progress bar.August 12, 2013 at 8:13 am #146521Paulie_DMemberYou can, I think, use a custom cursor but it’s not easy.
August 12, 2013 at 11:11 am #146541 -
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.