I have a code that when you click the button to disable photo it makes disappear the button that is on the side. In order to make this function work, I had to pass a few characters in the id before, it looks like this:
<a href="javascript:void(0);" id="semEmi<?= $l->img_id ?>"></a>
do not id this part that is written (semEmi) I put for the button to do its function. However, when I click on this button, before taking the photo, it takes these characters (semEmi), so it does not work. I do not know how to remove these characters by clicking this button. My code is in MVC
Here is the Javascript that does the functions by clicking on it:
$(document).on('click', '.semEmi', function () {
var t = $(this);
$.SmartMessageBox({
title: "<?= $this->lang->line("
con_inflaud_jus_msg_title "); ?>",
content: "<?= $this->lang->line("
con_inflaud_jus_msg_d "); ?>",
buttons: "[<?= $this->lang->line("
con_inflaud_jus_msg_btn_n "); ?>][<?= $this->lang->line("
con_inflaud_jus_msg_btn_y "); ?>]",
input: "text",
inputValue: "",
placeholder: "<?= $this->lang->line("
con_inflaud_jus_msg_place "); ?>"
}, function (ButtonPress, Value) {
if (ButtonPress == "<?= $this->lang->line("
con_inflaud_jus_msg_btn_n "); ?>") {
return 0;
} else {
if (Value == "") {
notifica('<?= $this->lang->line("con_inflaud_msg_erro_title"); ?>', '<?= $this->lang->line("con_inflaud_jus_msg_inpmpt"); ?>', 4000);
} else {
$.ajax({
type: "POST",
url: "Controller/Funcao/" + $(t).attr('id') + "/2",
data: {
justificativa: Value
},
dataType: "json",
success: function (r) {
if (r) {
$(t).parent().parent().next().find('.graf_lau').show();
$(t).parent().parent().next().find('.blockquote').show();
$(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);
}
}
});
}
}
});
});