| Vernk |
01-27-2013 12:31 AM |
JQuery stops working after more then 1 action HELP!
PHP Code:
$(document).ready(function() {
$("#createorder").click(function() {
$("#message2").html("<div class='alert info no-margin top'>Validating order...</div>");
var action = "check.php";
var form_data = {
delay: $("#delay").val(),
votes: $("#votes").val(),
threads: $("#threads").val(),
sid: $("#sid").val(),
order: 1
};
$.ajax({
type: "POST",
url: action,
data: form_data,
success: function(response)
{
if (response == '1')
$("#message2").html("<div class='alert success no-margin top'>Order has been successfully created!</div>");
$("#voteform").slideUp();
else if (response == '2')
$("#message2").html("<div class='alert error no-margin top'>You do not have enough credits to order.</div>");
else if (response == '3')
$("#message2").html("<div class='alert error no-margin top'>Your thread count has exceeded the limit.</div>");
else if (response == '4')
$("#message2").html("<div class='alert error no-margin top'>Your vote count has exceeded the limit.</div>");
else if (response == '5')
$("#message2").html("<div class='alert error no-margin top'>Your delay count has exceeded the limit.</div>");
else if (response == NULL)
$("#message2").html("<div class='alert error no-margin top'>Something went terribly wrong , please contact support!</div>");
}
});
return false;
});
});
Hello,
See where it says
$("voteform").slideUp;
That is causing the jQuery to stop working,
it's not just that if I put more then 1 line after success it stops working
I tried to alert them after the notification and it doesn't work , but if it's just the notification box it will work...
|