我想从我的网站创建一个表单,其中用户有两个下拉框,其值为body height
和type of build
。根据他们的选择,他们将被引导到一个页面,其中包含有关其特定/所选构建的信息。
要了解我想要创建的内容,这是我希望显示的表格.. 用于 BMX 自行车指南
函数 goToPage() { var type = document.getElementById("type").value; var height = document.getElementById("height").value; if(type !== 0 && height !== 0) { window.location = "http://www.maltabmx.com/About.html?jtype=" + 1 + "&height=" + 1;window.location = "http://www.maltabmx.com/Footage.html?jtype=" + 1 + "&height=" + 2; window.location = "http://www.maltabmx.com?jtype=" + 1 + "&height=" + 3; window.location = "http://www.maltabmx.com/About.html?jtype=" + 1 + "&height=" + 4; window.location = "http://www.maltabmx.com/Footage.html?jtype=" + 1 + "&height=" + 5; window.location = "http://www.maltabmx.com?jtype=" + 1 + "&height=" + 6; } }
<form> <p> Type of Terrain: </p>
选择街头/公园越野赛
<p>Body Height</p> <select id="height"> <option value="0" id="Select">Select</option> <option value="1" id="5ft">4ft</option> <option value="2" id="5.5ft">4.25ft</option> <option value="3" id="5.5ft">4.50ft</option> <option value="4" id="6ft">4.75ft</option> <option value="5" id="5ft">5ft</option> <option value="6" id="5.5ft">5.25ft</option> <option value="7" id="6ft">5.50ft</option> <option value="8" id="5ft">5.75ft</option> <option value="9" id="5.5ft">6ft</option> <option value="10" id="6ft">6.25ft</option> </select> <br /><br /> <input onclick="goToPage();" type="button" value="Submit" /> </form>