Al presionar el botón Enviar no se muestra mi texto, pero los valores aparecen en una nueva URL. ¿Cómo puedo arreglar esto? Intenté lo mismo antes con un estilo de formulario diferente que funcionó, pero necesitaba un nuevo estilo para la alineación...
var passes = document.getElementById("passes").value.toString(); var slots = document.getElementById("slots").value.toString(); function showInput() { document.getElementById("display-input").innerHTML = "You entered " + passes + " for the number of passes.\n" + "You entered " + slots + " for the number of passes."; return false; } <div class="form"> <form name="form" id="form" onsubmit="showInput(); return false;"> <table> <tr> <td>Passes: </td> <td><input type="number" name="passes" id="passes" /></td> </tr> <tr> <td>Slots: </td> <td><input type="number" name="slots" id="slots" /></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit" /></td> </tr> </table> </form> </div> <p><span id="display-input"></span></p>