I have a form and I would like it when I press a button to redirect me to a page with the values in the url, something like this:
"www.google.com?nom=luis&[email protected]".
This is my code:
<button id="send" onclick="prueba()">Enviar</button>
<script>
function prueba() {
var id = getParameterByName('id');
var email = document.getElementById("email").value;
var ocupacion = document.getElementById("ocupacion").value;
var dni = document.getElementById("dni").value;
var edad = document.getElementById("edad").value;
var estadoc = document.getElementById("estadoc").value;
var distrito = document.getElementById("distrito").value;
var nombrecon = document.getElementById("nombrecon").value;
var emailcon = document.getElementById("emailcon").value;
var ocupacioncon = document.getElementById("ocupacioncon").value;
var url = "https://creator.zohopublic.com/sandravillar/boarding-pass/page-perma/confirmation/NGDQsTnjyyWXYab9CWjGhVF0pQpZy9fMAeVK1nXgqkpjzAawVEWEMryRZseaeRHY5PzNk5qFRd8Dsu7XJg2JKMCwHTedsmTr1rej" + "?id=" + id + "&em=" + email + "&ocu=" + ocupacion + "&dni=" + dni + "&edad=" + edad + "&est=" + estadoc + "&dis=" + dis + "&nomc=" + nombrecon + "&emc=" + emailcon + "&ocuc=" + ocupacioncon;
window.location = "'"+url+"'";
}
Is it possible what I'm trying to do?