Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think this can be a starting point for what you're trying to do, you use the div's "display" property to show/hide it depending on what's selected in the dropdown:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function toggle() { var e = document.getElementById("selectList"); var strMortgageType = e.options[e.selectedIndex].value; var divToHide1 = document.getElementById("foundproperty"); var divToHide2 = document.getElementById("madeoffer"); if(strMortgageType == "Remortgage" || strMortgageType == "BuyToLetRemortgage") { divToHide1.style.display = "none"; divToHide2.style.display = "none"; } else { divToHide1.style.display = "block"; divToHide2.style.display = "block"; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;select id="selectList" name="namehere" title="Mortgage Type" onchange="toggle()"&gt; &lt;option value="FirstTimeBuyer"&gt;First Time Buyer&lt;/option&gt; &lt;option value="MovingHome"&gt;Moving Home&lt;/option&gt; &lt;option value="Remortgage"&gt;Remortgage&lt;/option&gt; &lt;option value="BuyToLetPurchase"&gt;Buy To Let Purchase&lt;/option&gt; &lt;option value="BuyToLetRemortgage"&gt;Buy To Let Remortgage&lt;/option&gt; &lt;/select&gt; &lt;div id="foundproperty"&gt; &lt;p&gt;Have You Found A Property&lt;/p&gt; &lt;input id="foundpropery" type="checkbox" value="0" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;/div&gt; &lt;div id="madeoffer"&gt; &lt;p&gt;Have You Made An Offer&lt;/p&gt; &lt;input id="madeofferInput" type="checkbox" value="0" /&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If you're using jquery, this post may be helpful:</p> <p><a href="https://stackoverflow.com/questions/4160234/jquery-if-select-has-option-1-show-div">Jquery : If select has option 1 show div</a></p>
    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.
    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