Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8297183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:18:39+00:00 2026-06-08T15:18:39+00:00

I am using jquery.form plugin, I don’t think my ajax loading gif placed a

  • 0

I am using jquery.form plugin, I don’t think my ajax loading gif placed a right selection in jQuery. Following are my codes, could someone tell me how to place the loading gif correctly.

Many thanks.

jQuery:

$(document).ready(function(){
    $("#contact-form").validate({

        // .......

        submitHandler: function(form) {
            $(form).ajaxSubmit({
                url:"echo/vali.php",
                type:"POST",
                success: function(){
                    $('#loader').css('visibility','visible');
                    $('#contact-form').hide();
                    $('#sent').show();
                    $('#loader').css('visibility','hidden');
                }
            });
        }
    });  
})

HTML:

<div id="loader"> <img src="images/loader.gif" width="18" height="18" / >

CSS:

#loader{
    float:left;
    margin:0px;
    position:relative;
    visibility:hidden;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:18:42+00:00Added an answer on June 8, 2026 at 3:18 pm

    One problem I see is that your HTML, as posted, is malformed. If you want the GIF to be inside of the #loader div, you need to make sure you close your tag:

    <div id="loader">
      <img src="images/loader.gif" width="18" height="18"/>
    </div>
    

    If that’s not the issue, have you checked to ensure that your #loader div displays correctly with its initial visibility set to visible?

    Edit:

    Another big issue is that you’re only showing the loader after the form was posted successfully — $('#loader').css('visibility','visible'); is in the success callback. Try changing your JS to this:

    $(document).ready(function(){
        $("#contact-form").validate({
    
            // .......
    
            submitHandler: function(form) {
                $('#loader').css('visibility','visible');
                $(form).ajaxSubmit({
                    url:"echo/vali.php",
                    type:"POST",
                    success: function(){
                        $('#contact-form').hide();
                        $('#sent').show();
                        $('#loader').css('visibility','hidden');
                    }
                });
            }
        });  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jquery form plugin which uses jquery ajax to do most
I'm using the jQuery validation plugin and the form uses ajax to submit the
So I have ajax file upload partial (using Jquery Form plugin), it's working perfectly,
The following script using jQuery validation plugin - http://docs.jquery.com/Plugins/Validation - is preventing the form
I'm using ExpressionEngine and SafeCracker along with Ajax (plugin: jquery.form.js - http://jquery.malsup.com/form/ ). Best
I'm using jquery form plugin http://jquery.malsup.com/form/#getting-started to upload images through ajax. When I try
I send asynchronous call using jQuery form plugin and in the case of success
I'm using jquery with the jquery form plugin . I read through a bunch
Hi everyone I was using the jQuery form plugin to process form submission (found
I am using jquery validation plugin for form validation. I have added a custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.