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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:31:24+00:00 2026-05-12T20:31:24+00:00

Hey guys, I’m working on a status-Updater. It works, there is just one problem,

  • 0

Hey guys, I’m working on a “status”-Updater. It works, there is just one problem, after sending a Status I have to manual reload the page to let the script work again. Do you can help me please? Here’s the code:

<script language="javascript">
$(document).ready(function(){
    $("form#status_form").submit(function(){
        var s_autor =   $('#s_autor').attr('value');
        var s_status    =   $('#s_status').attr('value');
        $.ajax({
            type: "POST",
            url: "/admin/request.php",
            data: "s_autor="+ s_autor +"& s_status="+ s_status,
            success: function(){
                $('#show').load("/admin/request.php").fadeIn("slow", function(){
                    setTimeout(function(){
                        $(function() {
                             $("#show").fadeTo("slow", 0.01, function(){
                                 $(this).slideUp("slow", function() {
                                     $(this).remove();
                                 });
                             });
                        });
                    }, 2000);
                });
            },
        });
        return false;
    });
});
</script>

So do you know how to code it to make it possible to repeat the script how often I click on the submit button?

By the way, here’s the HTML-Form:

<form id="status_form" method="post" action="request.php" onsubmit="return false;">
    <input type="text" id="s_autor" name="s_autor" value="<?= $user_id; ?>" style="display: none;" /><input type="text" id="s_status" name="s_status" value="Statusnachricht" /><input type="submit" value="" class="submit" id="status_submit" />
</form>
  • 1 1 Answer
  • 1 View
  • 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-12T20:31:24+00:00Added an answer on May 12, 2026 at 8:31 pm

    It looks like after your first time calling this code, you are destroying #show, and thus, the next time, there is no more #show? I’m going to add some comments to your code to see if i’m understanding this correctly:

    success: function() {
        // File has been successfully posted to request.php
        // We are now going to GET the contents of request.php (ignoring any response from the previous POST)
        // Also note, should probably put remainder of code in a callback to "load", so we can be sure it has had a chance to load!...
        $('#show').load("/admin/request.php").fadeIn("slow", function(){
            setTimeout(function(){
                $(function() {
                     $("#show").fadeTo("slow", 0.01, function(){
                         $(this).slideUp("slow", function() {
                             // Note! #show is being removed from the document here. It won't be available for future events.
                             $(this).remove();
                         });
                     });
                });
            }, 2000);
        });
    },
    

    Good luck!

    EDIT Upon looking at this some more, I noticed you are creating a document “ready” event after your setTimeout?

    I’m trying to figure out the effect you want. It looks like you want to have something fade in after the upload finishes (in the #show div), wait a few seconds, then fade it out again? (Your slideUp is acting on a faded-out element, so the effect won’t be seen.)

    How about something like this?

    success: function() {
        // File has been successfully posted to request.php
        // We are now going to GET the contents of request.php (ignoring any response from the previous POST)
        $('#show').load("/admin/request.php", function() {
            $(this).fadeIn("slow", function() {
                setTimeout(function() {
    
                    $("#show").fadeOut("slow", function() {
                        // don't remove #show. Just empty it for using again next time.
                        $(this).empty()
                    });
    
                }, 2000);
            });
        }); 
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
hey guys should be a easy one...I have some javascript that is turning my
Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine,
Hey guys, I have a raidan style 2d flying/fighter game that im working on.
Hey guys. Working on Mac OSX 10.6, My problem is that I would like
Hey guys, here's my requirement: I have one central App which receives requests from
hey guys I have a problem adding text inside an added html-tag I have
Hey guys I have a object sitting in my tile map for spawn point
Hey guys (and gals) I'm having a problem using Assembly GetExportedTypes() in .NET 4.0.
Hey guys am having a bit of problems with my jQuery, I have all

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.