N
Nathan Sokalski
I have an ASP.NET application which is giving the following JavaScript
error:
'theForm' is undefined
However, when I do a View Source one of the <script> elements is as follows:
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
You will notice that the first line of code in this script element creates
and assigns a value to a variable named "theForm". This code was generated
by ASP.NET, so it SHOULD be correct, and it looks to me like 'theForm' is
defined. I have seen other people post this error before also, but I can't
remember what they said they did to fix it. Any ideas? Thanks.
error:
'theForm' is undefined
However, when I do a View Source one of the <script> elements is as follows:
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
You will notice that the first line of code in this script element creates
and assigns a value to a variable named "theForm". This code was generated
by ASP.NET, so it SHOULD be correct, and it looks to me like 'theForm' is
defined. I have seen other people post this error before also, but I can't
remember what they said they did to fix it. Any ideas? Thanks.