Link to home
Start Free TrialLog in
Avatar of smithmrk
smithmrkFlag for United States of America

asked on

VS2012 / Javascript

This doesn't work and I don't know why?
    <script type="text/javascript">
        function GameDate() {
            if(document.getElementById('chk_AllGameDate.ClientID').checked)
            {
                document.getElementById('txt_GameDate.ClientID').disabled = 'false';
            }
            else
            {
                document.getElementById('txt_GameDate.ClientID').disabled = 'true';
            }
        }

    </script>
I want to enable a textbox when the checkbox is checked off!

I get this error when I click the Check Box:
0x800a138f - JavaScript runtime error: Unable to get property 'checked' of undefined or null reference
ASKER CERTIFIED SOLUTION
Avatar of Duy Pham
Duy Pham
Flag of Viet Nam image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smithmrk

ASKER

This Fixed my issue:

use server tag <%= chk_AllGameDate.ClientID %>