0
Include the JS Code below to disable the fields when checkbox is checked. However, when I load the page with it marked the fields need to be disabled, and the command only disables them when the click occurs. How can I disable controls (textbox) with page loading?
<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>
Presentation of the form with the fields
Top.. It worked.. Valew
– Gleison França