View Single Post
Old 01-27-2013, 12:31 AM   PM User | #1
Vernk
Regular Coder

 
Join Date: Oct 2011
Posts: 113
Thanks: 9
Thanked 1 Time in 1 Post
Vernk is an unknown quantity at this point
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(),
            
order1
        
};
        
        $.
ajax({
            
type"POST",
            
urlaction,
            
dataform_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...

Last edited by Vernk; 01-27-2013 at 01:29 AM..
Vernk is offline   Reply With Quote