I am trying to make the alert open the modal, but it is not working.
In the function I check if the nnfe
field is populated.
function TransferenciaPedido() {
if ($("nnfe").val() == undefined) {
alert("Preencha o número da NF-e corretamente.");
$('#myModalNFe').modal('show');
}
else {
}}
I've also tried to put return false;
, however, modal
does.
I call the function in a button
within the modal:
<button type="button" class="btn btn-success" onclick="TransferenciaPedido();" data-dismiss="modal">Concluir</button>