Eric Christianson
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"></scri pt>
*
*
*
<body onload="FormLoad()">
<script type="text/javascript" language="JavaScript">
function FormLoad()
{
document.all('txtMiscServi ceDate').f ocus(); // set focus to specific field on Load
}
</script>
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"></scri
*
*
*
<body onload="FormLoad()">
<script type="text/javascript" language="JavaScript">
function FormLoad()
{
document.all('txtMiscServi
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.