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 3399466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:46:29+00:00 2026-05-18T04:46:29+00:00

This is probably a very easy one to answer but still getting my head

  • 0

This is probably a very easy one to answer but still getting my head around structuring functions and bits in jQuery (and jquerytools). I’ve managed to parse the form and receive an email from the script but instead of displaying an alert box I would like to display another small div with a thank you message for X number of seconds before it closes the divs, clears the form and goes back to the main page.

Here’s the code I’m running:

<script> 
jQuery(document).ready(function() {
  jQuery ("a[rel]").overlay({mask: {color: '#000', loadSpeed: 200,opacity: 0.5}, top: '25%',} );
            jQuery('#form').ajaxForm(function() { 
                alert("Thank you for your comment!"); 
            }); 

});
</script>

<div class="home-block">
  <div class="home-block-content">
    <div class="home-block-col1">
      <h2>call us</h2>
      why not call our friendly designers or let us call you... <span class="callus">0845 6808107</span><br>
      <a href="#" rel="#callback" class="simpledialog">request a call back</a></div>
    <div class="home-block-col2"><a href="#" rel="#callback" class="simpledialog"><img src="{{skin url=""}}images/media/callus.png" border="0" alt="call us"  /></a></div>
  </div>
  <div class="clear-block"><br>
  </div>
</div>
<div class="simple_overlay" id="callback"> Please enter your details and we will call you back...<br />
  <br />
  <form id="form" name="form" method="post" action="{{skin url=""}}forms/callbackscript.php">
    <div class="callback-label">Name:</div>
    <div class="callback-field">
    <input name="name" type="text" size="25" class="callback-input"></div><div class="clear-block"></div>
    <div class="callback-label">Phone Number:</div>
    <div class="callback-field">
    <input name="phone" type="text" size="25" class="callback-input"></div><div class="clear-block"></div>
    <div class="callback-label">Callback time*:</div>
    <div class="callback-field">
    <select name="howsoon" class="callback-select">
    <option value="ASAP">As soon as possible</option>
    <option value="AM">AM</option>
    <option value="PM">PM</option>
    </select></div><div class="clear-block"></div>
    <div class="callback-label">Your Question:</div>
    <div class="callback-field">
      <textarea name="question" cols="27" rows="3" class="callback-input"></textarea><div class="clear-block"></div>
    </div>
<div class="callback-label"></div><div class="callback-field">
<input type="submit" name="Submit" value="Submit" />
  </form></div><div class="clear-block"></div>
<div class="note">*Please note we can only call back between the hours of 8-5 Monday-Friday and 9-1 on Saturday</div>
<div class="clear-block"></div>
</div>
  • 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-18T04:46:29+00:00Added an answer on May 18, 2026 at 4:46 am

    You could do something like this using the jQuery UI:
    (It is assumed that you would have a div with id “message” where the thank you message would be placed)

    <script> 
        jQuery(document).ready(function() {
            jQuery ("a[rel]").overlay({mask: {color: '#000', loadSpeed: 200,opacity: 0.5}, top: '25%',} );
            jQuery('#form').ajaxForm(function() { 
                jQuery("#message").html("Thank you for your comment!"); //see footnote 
                jQuery("#message").show("blind",null, 1000,function(){
                    setTimeout(close_message,10000);
                });
            }); 
        });
    
        function close_message() {
            jQuery('#message').hide("blind",null,1000,function(){
               window.location("<url to the home page>");//see footnote 2
             });
        }
    </script>
    

    The show() and hide() methods provide nice animations. Otherwise, you could just as easily change the class of the div to something that is visible.

    footnote 1 – You might want to consider taking the return data from the AJAX request and using it to populate the message, in case of errors.

    footnote 2 – I couldn’t tell from your post whether the “home screen” was another page on your site or another configuration (i.e. different divs) of the same page. Either way, the code to send the user “somewhere else” should go here in the hide() callback. This ensures that it is run when the animation finishes.

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

Sidebar

Related Questions

Hopefully, this will be an easy answer for someone with Javascript time behind them...
I'm using .Net 2.0 and this is driving me crazy but there's probably some
I know, I know... Eric Lippert's answer to this kind of question is usually
I feel like this is a stupid question, but I can't think of a
Stephan Walters video on MVC and Models is a very good and light discussion
using a Oracle 10g db I have a table something like this: create table
I'm pretty new to the Spring Framework, I've been playing around with it and
In one of my current side projects, I am scanning through some text looking
I want to display LaTeX math in the gmail messages that I receive, so
Is there a way for me to include a simple array of strings, or

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.