Community discussion forum

How do you check if element exists on the page?

  • 9 months ago
    Please help. How do you check if element exists on the page? Webpage Script Errors User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1) Timestamp: Tue, 27 Jan 2009 14:06:38 UTC Message: Object variable not set Line: 205 Char: 3 Code: 0 Message: Object doesn't support this property or method Line: 545 Char: 1 Code: 0
    Post was edited on 27/01/2009 14:30:09 Report abuse
  • 9 months ago
    My test (was stripped in the original post) - returns the error. if IsObject(document.getElementById("txtFName")) then msgbox document.getElementById("txtFName").value else msgbox "object not found" end if

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback