Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript HTML Progress bar

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #146479
    kanshul2013
    Participant

    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>
    
    #146485
    kanshul2013
    Participant

    The 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.

    #146490
    Paulie_D
    Member
    #146507
    kanshul2013
    Participant

    Is 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.

    #146509
    Paulie_D
    Member

    Is 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 or cursor:progress?

    Have you abandoned the idea of a progress bar?

    #146519
    kanshul2013
    Participant

    I 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.

    #146521
    Paulie_D
    Member
    #146541
    Chris Coyier
    Keymaster
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.