Skip to main content
Known Participant
March 28, 2007
Question

document is undefined

  • March 28, 2007
  • 2 replies
  • 362 views
Hi,
I wonder if anyone can help me out here I am writing a web application in asp javascript.
the problem is that when i enter the line shown below

document.forms["GroupForm"].elements["GroupDD"].disabled='true';

i keep getting the following error
Error Type:
Microsoft JScript runtime (0x800A1391)
'document' is undefined
/DCASuppliersDatabase/CategoryListing.Mod.asp, line 154

Why is this? I thought document is a valid keyword that points to the current page.

Regards

fifo
This topic has been closed for replies.

2 replies

Inspiring
March 28, 2007
Sounds like you're mixing up client-side and server-side code. They are
completely independant. You can't put client-side code inside your dynamic
<%%> blocks. ie. this won't work:

<%
document.forms["GroupForm"].elements["GroupDD"].disabled='true';
%>

will need to be on the client instead. ie

<script>
document.forms["GroupForm"].elements["GroupDD"].disabled='true';
</script>

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004




fifo85Author
Known Participant
March 28, 2007
Thanks so much Julian,

That did the trick, I thought all the code gets excecuted on the server side on asp. I'm new do web application
development, well this is my first one, I could really do with an insight into how the whole system (client side/server side) works.
you know any useful sights where i can get a good grounding into web application development and javascript/asp.

Thanks Again,

Fifo
Inspiring
March 28, 2007
fifo85 wrote:
> i keep getting the following error
> Error Type:
> Microsoft JScript runtime (0x800A1391)
> 'document' is undefined
> /DCASuppliersDatabase/CategoryListing.Mod.asp, line 154

That's usually the result of a corrupted file cache. Try the solution here:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
fifo85Author
Known Participant
March 28, 2007
Thanks for the response,

but the error i get occurs when i run my application on the web browser

the link that you sent does not cover runtime errors,
any hints?