I have a query i hope you can help with, i have searched but cant find an answer to my exact question.
I have a drop down (select) menu that depending on selection needs to show 2 extra fields
Every other question I have seen depends on different selections showing different fields.
<select id="idhere" name="namehere" title="Mortgage Type">
<option value="First Time Buyer">First Time Buyer</option>
<option value="Moving Home">Moving Home</option>
<option value="Remortgage">Remortgage</option>
<option value="Buy To Let Purchase">Buy To Let Purchase</option>
<option value="Buy To Let Remortgage">Buy To Let Remortgage</option>
</select>
The following need to show 2 extra form fields (held within a div below)
First Time Buyer
Moving Home
Buy To Let Purchase
These both do not need to show the extra fields
Remortgage
Buy To Let Remortgage
Finally The Extra Fields are:
<p>Have You Found A Property</p>
<input id="foundpropery" type="checkbox" value="0" />
<br />
<br />
<p>Have You Made An Offer</p>
<input id="foundproperty" type="checkbox" value="0" />
Using javascript? How do i show the extra fields depending on selection
In advance thanks for any help!
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:
If you’re using jquery, this post may be helpful:
Jquery : If select has option 1 show div