Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question ASP-Error message

    Okay, I'm getting this error message everytime I try to run this test asp page I'm trying to build. This is the error message:

    Error Type:
    Microsoft JScript runtime (0x800A1391)
    'document' is undefined
    redValidate2.asp, line 143


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)

    Page:
    GET /practice/leo2/redValidate2.asp


    I think the problem is that the document method is javascript method and the asp page is not recognizing it. I'm not exactly sure how to get around the problem or fix it. The code on this line is:

    <script language="javascript" runat=server>
    function jsproc(num1,num2)
    {
    Response.Write(num1*num2)
    }

    var test = (document.getElementsByTagName && document.createElement);

    function validate() {...</script>

    I'm trying to ultimately run the validation function that is the last line of the code but it's not even getting that far because. What it is i'm trynig to do with that function is send an error message (that is not an window pop-up alter)to the user telling them about some error, perhaps "invalid password." But instead of a alert I wanted it to appear on the actual page. Much like the error message you get if you login to this site w/ the wrong password. If someone could help me with this or help me find an alternate route (other than using this function, or DOM) to do what I'm really trying to do that would be great. Thank you.
    Last edited by solom190; 08-27-2007 at 03:37 PM.

  • #2
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,063
    Thanks
    0
    Thanked 14 Times in 14 Posts
    Essentially this error is stating that the reference to document is not defined or declared. Please provide the code for redValidate2.asp.

    -saige-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <script language="javascript" runat=server>
    function jsproc(num1,num2)
    {
    Response.Write(num1*num2)
    }

    var test = (document.getElementsByTagName && document.createElement);

    function validate() {...</script>

    That is the code from redValidate.asp that the error appears on. The bold text is the exact line. This is the first reference of the javascript .documemt method and the problem is that I do not get this error about the reference to document; not being defined or declared when the script says:

    <script type="text/javascript">

    but when it is written:

    <script language="javascript" runat=server>

    I get this document error. I use the second one because it the only way I could think of to get pass a VBScript runtime error, that i get with javascript functions.

  • #4
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    var test = (document.getElementsByTagName && document.createElement);
    is client-side code not server side code.

    When using JScript on the server, there is no document object available. That is only available in use on client side code. That is why you are getting the error.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •