Hi,
I have a form on and ASP page that has a checkbox (chkAnyTheme) which
disables a list box (txtListThemes) with an onclick event. I also have
the follwoing code that checks if the chkAnyTheme is checked when the
page loads and if so disableds txtListThemes:
<script type="text/javascript">
var IsChecked = document.getElementById("chkAnyTheme")
if (IsChecked.checked)
{
document.getElementById("txtListThemes").disabled = true
alert("Checked is True")
}
</script>
this works fine when the page is loaded from the server but i also
need it to work if the user uses the back/forward button. At the
moment the moment the script is not picking up if chkAnyTheme is
checked and doesn't disable txtListThemes. Then if the user clicks on
chkAnyTheme the on click code that disables txtListThemes gets
confused and disables txtListThemes when chkAnyTheme is not checked
and vice versa.
I think that maybe when the page loads using the back/forward buttons
the code is exectued before checkbox is assigned a value. Does anyone
know a way of getting round this?