Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to do Page Redirection based on two drop down menu selections?
    text
    copied!<p>I want to create a form from my website where the user has two dropdown boxes with values say <code>body height</code> and <code>type of build</code>. Depending on their selection, they would be directed to a page with information about their specific/selected build.</p> <p>To have an idea of what I want to create, here is the form i wish to display.. the use if for a BMX bike guide</p> <blockquote> function 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; <pre><code> window.location = "http://www.maltabmx.com/Footage.html?jtype=" + 1 + "&amp;height=" + 2; window.location = "http://www.maltabmx.com?jtype=" + 1 + "&amp;height=" + 3; window.location = "http://www.maltabmx.com/About.html?jtype=" + 1 + "&amp;height=" + 4; window.location = "http://www.maltabmx.com/Footage.html?jtype=" + 1 + "&amp;height=" + 5; window.location = "http://www.maltabmx.com?jtype=" + 1 + "&amp;height=" + 6; } } </code></pre> <pre><code>&lt;form&gt; &lt;p&gt; Type of Terrain: &lt;/p&gt; </code></pre> <p> Select Street/Park Dirt Racing </p> <pre><code>&lt;p&gt;Body Height&lt;/p&gt; &lt;select id="height"&gt; &lt;option value="0" id="Select"&gt;Select&lt;/option&gt; &lt;option value="1" id="5ft"&gt;4ft&lt;/option&gt; &lt;option value="2" id="5.5ft"&gt;4.25ft&lt;/option&gt; &lt;option value="3" id="5.5ft"&gt;4.50ft&lt;/option&gt; &lt;option value="4" id="6ft"&gt;4.75ft&lt;/option&gt; &lt;option value="5" id="5ft"&gt;5ft&lt;/option&gt; &lt;option value="6" id="5.5ft"&gt;5.25ft&lt;/option&gt; &lt;option value="7" id="6ft"&gt;5.50ft&lt;/option&gt; &lt;option value="8" id="5ft"&gt;5.75ft&lt;/option&gt; &lt;option value="9" id="5.5ft"&gt;6ft&lt;/option&gt; &lt;option value="10" id="6ft"&gt;6.25ft&lt;/option&gt; &lt;/select&gt; &lt;br /&gt;&lt;br /&gt; &lt;input onclick="goToPage();" type="button" value="Submit" /&gt; &lt;/form&gt; </code></pre> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload