Control Colapsable Panels with Select List
I am trying to open a Colapsable Panel if one option is selected OR other panels if a different option is selected.
The code I have is
<select class="formMenufield_Medium" name="Insurance_group_Insurance_Product" id="Insurance_group_Insurance_Product" tabindex="5" onblur="hideServerError('Insurance_group_Insurance_Product_ServerError');" onchange="if (this.options[this.selectedIndex].value=='4') CollapsiblePanel1.open();
if (this.options[this.selectedIndex].value=='5') CollapsiblePanel2.open(); CollapsiblePanel4.open(); CollapsiblePanel5.open(); CollapsiblePanel6.open();">
<option value="1">Buildings Insurance</option>
<option value="2">Contents Insurance</option>
<option value="3">Buildings and Contents Insurance</option>
<option value="4">Tenants Contents Insurance</option>
<option value="5">Landlords Buildings Insurance</option></select>
At the moment if I select value 4 everything opens, but if I select value 5 only the items listed open.
How would I stop the script after value 4 has been selected (so that value 5s option aren't opened?)
I was thinking of an else type statement but I am still learning this stuff.