In my directory I have the following HTML pages: public_html // Index.html // proof_protocol.html // protocol_menu.html
On the "protocol_menu" page we have created a form. The goal is that after giving the submit in the form open the page "voucher_protocol" in a new tab. The code for the protocol data to be registered is:
function EditarCadastrarProtocolo() {
if (document.getElementById("idProtocolo").value == "") {
AdicionarProtocolo();
} else {
EditarProtocolo(document.getElementById("idProtocolo").value);
}
}
function AdicionarProtocolo() {
var cod = GerarIdProtocolo();
$("#idProtocolo").val(cod);
var select = document.getElementById("clienteProtocolo");
var clienteSelecionado = select.options[select.selectedIndex].value;
var protocolo = JSON.stringify({
codigo: cod,
data: $("#dataProtocolo").val(),
codCliente: clienteSelecionado,
observacoes: $("#observacoes").val()
});
tbProtocolos.push(protocolo);
localStorage.setItem("tbProtocolos", JSON.stringify(tbProtocolos));
alert("Protocolo " + cod + " Cadastrado com Sucesso!");
ListarProtocolos();
}
I'm trying to make sure that after submitting the "voucher_protocol.html" page open in a new tab, where a form will be presented with the data and other information to be delivered to the client and signed. I thought about putting the code like this:
'if (document.getElementById ("idprotocolo"). value == "") { AddProtocol (); window.open ......; '
It did not work and I did not find anything similar on the internet, does anyone have any idea how to do this?