I have the following HTML, but everything on the same page id entry is where it gets my input field from the typed address arrival is where it gets the final address result is the calculation:
<div id="entrada"></div>
<div id="chegada"></div>
<div id="Resultado"></div>
<input type="submit" class="btn-green" id="btnCalcular" onclick="calcular();" value="Calcular" />
I have this function to calculate my input text:
<script language= "javascript">
function calcular(){
var litros = parseFloat(document.getElementById('txtKM').value) / parseFloat(document.getElementById('txtKML').value);
var valor = parseFloat(document.getElementById('txtPL').value) * litros;
document.getElementById('Resultado').innerHTML = "<br><b>Gasto total: R$ </b>" + valor;
var txtentrada = document.getElementById('txtEnderecoPartida').value;
document.getElementById('entrada').innerHTML = "<br><b>Endereço de Partida:</b><br>" + txtentrada;
var txtchegada = document.getElementById('txtEnderecoChegada').value;
document.getElementById('chegada').innerHTML = "<br><b>Endereço de Chegada:</b><br>" + txtchegada;
}
</script>
Now, what I wanted to know is: How do I click the button to open it on another page (poup-up), already tried with windows.open but does not open, since my onclick is calling this function on the same page to calculate.
EDIT: I have this HTML:
<a href="index.php" onclick="window.open('index.php', 'Pagina', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=YES, TOP=10, LEFT=10, WIDTH=900, HEIGHT=500');">
I wanted to pull the result information to a new page;