Link to home
Start Free TrialLog in
Avatar of Eric Christianson
Eric ChristiansonFlag for United States of America

asked on

JavaScript Function no longer working since moving to VS 2010

Greetings -

I used to use the following function to place the cursor in a specific field in ASP.Net.  since moving to VS 2010, it no longer works, producing this error:
JavaScript runtime error: Unable to get property 'focus' of undefined or null reference

What is the new syntax?

Here is my old code:

<script type="text/javascript" language="JavaScript" src="MenuReturn.js"></script>
*
*
*
      <body onload="FormLoad()">
            <script type="text/javascript" language="JavaScript">
                function FormLoad()
                {
                    document.all('txtMiscServiceDate').focus();    // set focus to specific field on Load
                }
            </script>
ASKER CERTIFIED SOLUTION
Avatar of Francisco Igor
Francisco Igor
Flag of Canada 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