I'm using a flexbox (fairwaytech.com/flexbox/) as an alternative to a normal dropdown box as there are hundreds of options to choose from on my form. If some of those options are selected, I want a hidden DIV to appear without having to refresh the page.
In this case the flexbox determines job titles. So, if the user types in 'Doctor' and selects the result, then the flexbox returns the code <input type="hidden" id="fb_hidden" name="fb" value="2">
, where the value 2 relates to the job title 'Doctor' in the database.
When somebody selects Doctor I want a hidden div to appear, but if a different job title is selected, it stays hidden. Can somebody help me with this please? Here's my code:
<input type="hidden" id="fb_hidden" name="fb" value="2">
<div id="hide" style="display:none;">
<div>
Title
</div>
<div>
<input id="number" name="number" type="text" value="">
</div>
</div>