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

  • Home
  • SEARCH
  • 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 6700617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:50:10+00:00 2026-05-26T06:50:10+00:00

I have three forms on one page – callback, contact us and newsletter subscription.

  • 0

I have three forms on one page – “callback”, “contact us” and “newsletter subscription”.

Each has it’s own jQuery function to “post” the data (using .post) and then display any returned PHP. These forms only output simple error and successes depending on the form and the process.

Now, here is where it gets a bit odd… all three of my forms work but only two work as expected:

  1. Response DIV hides
  2. Response DIV fills with returned HTML
  3. Response DIV fades in nicely.

My main “contact us” form, however, is the odd one out… the response DIV immediately appears with no fade effects.

I have read that I should first “hide()” the DIV – which I have tried without any success and nothing seems to work.

I have noticed that if I return purely text (echoed by PHP) then the fade works…. but when I try to get it to output any HTML tags then it all fails and the DIVs appear immediately…

My Form response:

<div><span id="contactUsAjaxResponse"></span><div>

My jQuery function

$(document).ready(function(){
$("#contactUsForm").submit(function(){
var responseDiv = '#contactUsAjaxResponse';
// add ajax-loader class to response div
$(responseDiv).html('').addClass('ajax-loader');
// get form actiom
var formAction = $(this).attr('action');
$.post(formAction, $("#contactUsForm").serializeArray(), function(data){
$(responseDiv).removeClass('ajax-loader').html(data).fadeIn('slow');
});
return false; //prevent default form action
});
});

Any echoed HTML is <php echo '<div class="error">Content...</div>'; ?> etc.

I have a feeling it could be my CSS (could any display: block; or other entries be causing the problem?)

Many Thanks

  • 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-05-26T06:50:10+00:00Added an answer on May 26, 2026 at 6:50 am

    The best way (imo) is to have the result-div (that you call error) already present on your webpage. Hide it with css using display: none and make it empty. When the result is retreived, use fadeIn(‘slow’) on that element.

    The base line is that there is no point in hiding a div using js, and then show it later. This can simply be done using css

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three pages that has forms on them. They all lead to one
Is it possible to have multiple contact forms on one page and still validate
I have an ASP.NET form with three text inputs, one each for Work Phone,
I have several dynamically created links and forms on one page named with IDs
I have two forms on one page: a results form and a search form.
i have 2 or more forms in one page. like this: <form method=post >
On one of my websites I have 2 forms on one page, I am
I have a page with three forms. I'd like to run different db calls
In VB.net 3.5 SP1 I have a Windows Form with three DataGridView controls. One
I have a windows forms application in .NET 3.5. There's one form with 20

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.