Results 1 to 5 of 5

Thread: Loading...Please Wait message on form submit

  1. #1
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default Loading...Please Wait message on form submit

    I am using an html form to upload video files.

    A php script handles the video file once it is uploaded.

    When the user presses the submit button, the form continues to display for 3 - 4 minutes while the video is uploaded. Once the file is uploaded and the php script completes its work, the screen changes to a success message.

    I would like to display a "Please Wait, uploading your video" message in the middle of the screen while the video file is uploaded.

    At first I thought this would be easy to do, but I have not been able to figure it out myself or find a good solution online.

    Would someone point me in the right direction please?

    Thanks a lot!

    Jason

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Best way is through AJAX, but:
    Code:
    <script type="text/javascript">
    var ray={
    ajax:function(st)
    	{
    		this.show('load');
    	},
    show:function(el)
    	{
    		this.getID(el).style.display='';
    	},
    getID:function(el)
    	{
    		return document.getElementById(el);
    	}
    }
    </script>
    <style type="text/css">
    #load{
    position:absolute;
    z-index:1;
    border:3px double #999;
    background:#f7f7f7;
    width:300px;
    height:300px;
    margin-top:-150px;
    margin-left:-150px;
    top:50%;
    left:50%;
    text-align:center;
    line-height:300px;
    font-family:"Trebuchet MS", verdana, arial,tahoma;
    font-size:18pt;
    }
    </style>
    <div id="load" style="display:none;">Loading... Please wait</div>
    <form action="http://www.yahoo.com" method="post" onsubmit="return ray.ajax()">
    <input type="text" value="Test" name="q">
    <input type="submit" value="Search">
    </form>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    JasonDFR (11-12-2008)

  4. #3
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Rangana,

    This works great. Thank you very very much. I looked everywhere for a simple solution like this and couldn't find it.

    You are a huge asset to these forums.

    I am starting to learn javascript. Once I have a decent foundation, I'll go for AJAX. With AJAX we could have an upload progress bar etc...(I think)

    Have a great day.

    Jason

  5. #4
    Join Date
    Apr 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It seems that this solution works for me, I'm assembling a 6k row table from a Mysql db to a hash, then output.

    However, it seems to remove the popup when the content is caching to the client (ie seems to pop it up after it downloads). Is there a way to overcome this and have the popup remain until load is complete in the browser?

  6. #5
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    How would I apply this script to a php button confirming an ordering in a shopping cart such as the one below, to tell users to wait while their order is being processed?

    <?php
    if (is_array($payment_modules->modules)) {
    echo $payment_modules->process_button();
    }

    echo tep_image_submit ('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •