Include the JS Code below to disable fields when the checkbox is checked. However, when I load the page with it checked the fields need to be disabled, and the command only disables them when the click occurs. How can I disable the controls (textbox) with page load?
<script type="text/javascript">
$(document).ready(function ()
{
$('#chkContaProvisoria').click(function ()
{
if (this.checked)
{
$('#DadosConta_Conta_DtValidade').attr("disabled", "disabled");
$('#DadosConta_Conta_Numero').attr("disabled", "disabled");
}
else
{
$('#DadosConta_Conta_DtValidade').removeAttr("disabled")
$('#DadosConta_Conta_Numero').removeAttr("disabled")
}
});
});
</script>
Form submission with fields