Ajax does not work with specific button

1

I have a code that when clicking the button it asks for a click reason. After writing the reason he changes the button and should change the information listed below. This code is in Ajax but it is not working properly. By clicking this button, he asks for this justification and changes the button, but does not exchange the information. NOTE: The same code works with the other button that disables the image I have, but with this button it does not work.

The part that is not working is this:

success: function(r) {
    if(r) {
        $(t).parent().parent().next().find('.msg_SemEmi').show();                        
        $(t).parent().parent().next().find('.graf_laudo').show();                        
        $(t).parent().parent().next().find('.graf_lau').css('display','none');
        $(t).parent().parent().next().find('.img_lau_d').show();
        $(t).parent().parent().next().find('.img_lau_a').css('display','none');
        $(t).removeClass('semEmi btn-default');
        $(t).addClass('comEmi btn-warning');
        $(t).empty();
        $(t).append('<span class="btn-label"><i class="fa fa-check-square-o"></i></span><?= $this->lang->line("con_inflaud_afe_comEmi"); ?>');
    } else {
        notifica('<?= $this->lang->line("con_inflaud_msg_erro_title"); ?>', '<?= $this->lang->line("con_inflaud_msg_erro_d"); ?>', 4000);
    }
}

Here is the HTML that calls this Ajax:

<div class="btn_semEmi">
    <input type="hidden" id="input_semEmi<?= $l->img_id ?>" name="id_foto" value="<?= $l->img_id ?>">
    <a href="javascript:void(0);" id="semEmi<?= $l->img_id ?>"  id-foto="<?= $l->img_id ?>" class="btn btn-labeled btn-default pull-right semEmi"> <span class="btn-label"><i class="fa fa-ban"></i></span><?= $this->lang->line("con_inflaud_afe_semEmi"); ?></a>
</div>

My code is in MVC

    
asked by anonymous 09.09.2015 / 15:43

0 answers