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> Well, the file "request.php" is looking like this (in the moment!): <div class="inhalt"><div class="text">Erfolgreich eingetragen!</div></ div> The PHP-Part is coming up. I want to reach that if I click on the submit-Button, the jquery-code works. Well, it works, but just ONE TIME. After clicking the first time on the submit-button, the script SHOULD work like it did the first time. But if I click on the submit button the second time, nothing works. Anyway: I want the script work as often I click on the submit button.... Hope you understand me. My english is not the best... (I'm german...)