Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Any Title&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;script type="text/javascript"&gt; var firmwares = {}; firmwares[1] = {"Sacramento" : "http://www.abc.com", "San Diego" : "http://www.abc.com", "San Francisco" : "http://www.abc.com", "Los Angeles" : "http://www.abc.com"}; firmwares[2] = {"Cleveland" : "http://www.abc.com", "Akron" : "http://www.abc.com", "Canton" : "http://www.abc.com", "Cincinnati" : "http://www.abc.com", "Columbus" : "http://www.abc.com"}; firmwares[3] = {"Philadelphia" : "http://www.abc.com", "Pittsburgh" : "http://www.abc.com", "Harrisburgh" : "http://www.abc.com"}; firmwares[4] = {}; function fillSelect(nValue,nList){ nList.options.length = 1; var curr = firmwares[nValue]; for (each in curr) { var nOption = document.createElement('option'); nOption.appendChild(document.createTextNode(each)); nOption.setAttribute("value",each); nList.appendChild(nOption); } document.getElementById("gotoCity").style.display = "none"; } function openCity(firmware, city) { var gotoCity = document.getElementById("gotoCity"); gotoCity.href = firmwares[firmware][city]; gotoCity.style.display=""; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form method="post" action=""&gt; &lt;div&gt; &lt;select name='phones' onchange="fillSelect(this.value,this.form['firmwares'])"&gt; &lt;option value=""&gt;Select Your State&lt;/option&gt; &lt;option value="1"&gt;California&lt;/option&gt; &lt;option value="2"&gt;Ohio&lt;/option&gt; &lt;option value="3"&gt;Pennsylvania&lt;/option&gt; &lt;option value="4"&gt;Alaska&lt;/option&gt; &lt;/select&gt; &lt;select name='firmwares' onchange="openCity(this.form['phones'].value, this.value)" &gt; &lt;option value=""&gt;Select Your City&lt;/option&gt; &lt;/select&gt; &lt;a id="gotoCity" href="#" style="display:none;"&gt;Go&lt;/href&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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