I have an ASP.NET application which is giving the following JavaScript
error:
'theForm' is undefined
However, when I did a View Source I noticed that ASP.NET added the following
code:
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(ev entTarget, eventArgument) {
if (!theForm.onsub mit || (theForm.onsubm it() != false)) {
theForm.__EVENT TARGET.value = eventTarget;
theForm.__EVENT ARGUMENT.value = eventArgument;
theForm.submit( );
}
}
// -->
</script>
I was told in a previous posting that the reason for the error is that the
script containing the declaration and assigning of a value to it occur
before the
--
Nathan Sokalski
njsokalski@hotm ail.com
error:
'theForm' is undefined
However, when I did a View Source I noticed that ASP.NET added the following
code:
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(ev entTarget, eventArgument) {
if (!theForm.onsub mit || (theForm.onsubm it() != false)) {
theForm.__EVENT TARGET.value = eventTarget;
theForm.__EVENT ARGUMENT.value = eventArgument;
theForm.submit( );
}
}
// -->
</script>
I was told in a previous posting that the reason for the error is that the
script containing the declaration and assigning of a value to it occur
before the
--
Nathan Sokalski
njsokalski@hotm ail.com
Comment