Validate DropDownList if checkbox checked
<p>ASP.NET3.5 Webforms. Am trying to put a validator on the drop down list, only if the checkbox is checked.</p>

<p>This doesn't work.  If I put an alert in the onclick event, it does show.</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    function setVal(sender) {
        var myVal = document.getElementById('&lt;%=(DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddlSupplierCouncilArea")%&gt;');
        ValidatorEnable(myVal, !sender.checked);
        ValidatorValidate(myVal)
    }  
&lt;/script&gt;

&lt;asp:CheckBox runat="server" ID="cbxIsSupplier" Text="I wish to register as a Supplier in the"
                                     OnClick="setVal(this)" /&gt;

&lt;asp:DropDownList ID="ddlSupplierCouncilArea" runat="server"&gt;
                                    &lt;asp:ListItem&gt;[Please select]&lt;/asp:ListItem&gt;
                                    &lt;asp:ListItem Value="blah1"&gt;blah1&lt;/asp:ListItem&gt;
                                    &lt;asp:ListItem Value="Waimakariri"&gt;blah2&lt;/asp:ListItem&gt;
                                &lt;/asp:DropDownList&gt;
                                &lt;div class="validators"&gt;
                                    &lt;asp:RequiredFieldValidator ID="rfvCouncilArea" runat="server" InitialValue="[Please select]"
                                        ControlToValidate="ddlCollectorCouncilArea" ErrorMessage="Select a Council Area"
                                        Enabled="false" ToolTip="Select a council area" ValidationGroup="CreateUserWizard1"&gt;* required&lt;/asp:RequiredFieldValidator&gt;
                                &lt;/div&gt;
</code></pre>
