Animated gif after clicking submit

Discussion in 'JavaScript' started by Sipifi, Feb 26, 2009.

  1. #1
    Hey all,

    I've been searching and searching but only found solutions that didn't work for me or were totaly not related to what i was looking for (is google getting worse with all those product selling spam sites? :()

    Anyway! I'd love to show a "loading" image when someone clicks submit on a uploading form i have and my best bet is to use javascript for it, but i'm very new to that. Where do i start?

    For example: user browses for a file, then clicks submit and then the loading image shows up untill the page gets redirected to another.

    Hope someone can help me out :)

    /Sipifi
     
    Sipifi, Feb 26, 2009 IP
  2. manjifera

    manjifera Well-Known Member

    Messages:
    232
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    118
    #2
    <script>
    function sub()
    {
    document.getElelmentById("myloadng").innerHTML = "<img src='image link here'>";
    }
    <script>
    
    
    <div id="myloadng"></div>
    HTML:
     
    manjifera, Feb 26, 2009 IP
    Sipifi likes this.
  3. Sipifi

    Sipifi Well-Known Member

    Messages:
    530
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    155
    #3
    How and where would i add this? I know the javascript has to go in the head section, but do i add the div around my form or just where i want to get the image to show? I tried the last method and it did nothing so.
     
    Sipifi, Feb 26, 2009 IP
  4. Sipifi

    Sipifi Well-Known Member

    Messages:
    530
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    155
    #4
    Anyone have an idea?
     
    Sipifi, Feb 27, 2009 IP