Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: loading image

  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default loading image

    can anyone help me with a code that I can use in a html form.. when we click submit a image appear on the page with a loading gif file while the html goes to the post response page.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    When a form is submitted, the action of the form is like a link-- the browser goes there, and it also sends the data to that page.
    So the page that loads and the page that gets the data must be the same.

    You can try to work around this a few ways:

    1. You could use frames, and submit the data to an iframe/frame on your page while the main page does a loading gif.

    2. You could just have a loading gif for a few seconds (5?) until it submits the form (delay the form submission and open the gif with Javascript).

    3. You could use Ajax or another similar method to submit the form in the background and stay on the same page, while loading a gif.


    Also, you could actually make the second page yourself, with a loading gif or whatever you want, and program that page (with PHP, etc.) to accept the data.



    For a more specific answer, you need to explain a little more about what you want to do, give an example, or pick one of the options above.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post

    2. You could just have a loading gif for a few seconds (5?) until it submits the form (delay the form submission and open the gif with Javascript).
    how about this one?

  4. #4
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    help?

  5. #5
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    bump..

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

    Default

    [Spam, deleted]
    Last edited by djr33; 10-07-2009 at 01:17 AM.

  7. #7
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by masgenpin View Post

    3. You could use Ajax or another similar method to submit the form in the background and stay on the same page, while loading a gif.
    ________________
    thank you for your reply but can you please tell me how to do this as i have to knowledge about Ajax or any idea for this..

  8. #8
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Have a look at this link, it shows how to display an image on form submission.

    http://www.mollerus.net/tom/blog/200...rance_aft.html

    Don't know if that's what you're looking for?

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Use a script like one of the many incarnations of "lightbox" and display a loading gif. Trigger this event on form submission with a 5 second delay until the next page loads.

    The link above looks helpful too.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Use a script like one of the many incarnations of "lightbox" and display a loading gif. Trigger this event on form submission with a 5 second delay until the next page loads.

    The link above looks helpful too.

    could it be something like this in Submit button

    Code:
    rel="lightbox" onclick="showLoading(this);"
    and this in js

    Code:
    	        
    
    function showLoading(button) {
        
            one = new Image ( );
            one.src = "loading1.gif";
    		button.style.color = '#676561';
    	wait(400);  // Else the form will submit before the background image changes
    	return true;
    
            
            }

    i know this is wrong but there might be a correction and it will work

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
  •