I need to enable/disable an asp.TextBox/Input depending on a CheckBox. If the CheckBox.Checked = true then I need to enable the asp.TextBox/Input or if the CheckBox.Checked = false I then need need to disable the asp.TextBox/Input. 

Below is the code I have but it only works on first click, meaning if I check the box it will enable the asp.TextBox/Input but if I uncheck it will not disable the asp.TextBox/Input. 

Also, by default the asp.TextBox/Input is disable on Page\_Load. 

```
//If checked it should enable the input.
//If unchecked it should disable the input.
If Port is Required?<label class="checkbox">
                        <input type="checkbox" id="isportreqinput" name="isportreqinput" runat="server" onclick="fncport(this.form.isportreqinput, this.form.porttxt);"  />
                        <span class="metro-checkbox">Check Me</span>
                    </label>

//This is the input I need to disable/enable depending on the checkbox
<input type="text" name="porttxt" id="porttxt" runat="server" disabled="disabled" />

    <script type="text/javascript">
        function fncport(control, objname) {

            if (control.checked == true) {
                objname.disabled = false;
            }
            if (control.cheched == false) {
                objname.disabled = true
            }
        }
    </script>

```