Element XXX is undefined in FORM But Only Sometimes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • calexander
    New Member
    • Apr 2008
    • 4

    Element XXX is undefined in FORM But Only Sometimes

    I'm supporting a web site (6 web servers and 2 DB servers) that's using ColdFusion MX Version: 6,1,0,83762. We have logging set up where we get email notification of errors. We have gotten 90 of these errors, since Oct. 2007, about undefined form elements, but they are clearly defined on the page. There are 10 different pages that this error has occurred on. And it's happening with users using both IE 6 and IE 7. It’s happening with both <cfform> and <form>. Some are text and some are checkboxes. Some pages post to themselves and some posts to a hidden window. And to top it off, I am unable to duplicate this issue in dev or production (nice, right?). Here are two examples of undefined values:

    Code:
    <td>$<input type=text name="targprice" value="#Trim(NumberFormat(targprice,'999999.99'))#" tabindex="6" id=numberinput size="9" onFocus="select();" onBlur="doFormatCurrency(this);"></td>
    
    <input type="checkbox" name="procs" value="#UrlEncodedFormat(sql)#" #chk#>
    I've tried setting the database fields in question to null thinking that CF may be removing these fields because they are null but I'm still unable to reproduce it. I’ve also tried adding single and double quotes to some of the database fields and was unable to reproduce it.

    Has anyone experienced this or have any ideas?
    Last edited by Rabbit; Jan 28 '13, 04:58 PM. Reason: Please use code tags when posting code.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to bytes.com!

    Roughly how many requests are we talking about out of which you've got 90 error pages?

    To avoid the errors, you can use cfparam to define default values for them.

    Can you show the code where the error actually occurs?

    Comment

    • calexander
      New Member
      • Apr 2008
      • 4

      #3
      Looking at the logs on all of the web servers for yesterday, one of the pages in question got 448 requests. If you multiple that by 170 days (Since Oct 25th) that puts it in a rough estimate of 76,000 request. Out of these requests, we 6 errors about one field that was missing, and another 6 errors about a different field that was missing. So this one page is throwing an error roughly .02% of the time. So it’s not happening that much per page, but the thing is, its multiple pages doing it as well.

      I’ll try using cfpram to the pages. That should do the trick, but it doesn’t explain what’s causing the form elements to not get rendered. So it might mask the underlying issue and pass it along to the next form element or another part of the page.

      Sorry, but I talked to my project manager and even after I tried to mask the sensitive information on the page, he still didn’t feel comfortable with me posting the code. But the form and elements are clearly defined on the page. The only thing that I can see that could possibly cause an issue is some of the elements are being formatted and set by JavaScript. But we require that JavaScript be enabled, and there's just no way a user could make it this far in the application if they didn't have it enabled. In addition, I’ve tried testing locally by setting the elements to null, they are still rendering for me.

      I did read a thread that was similar about having multiple pages and multiple forms that could cause possible cause the wrong form to get submitted. And being that the web site uses some of the same form name for different pages, and then this raises an interesting point. But I was still unable to even duplicate this hypothesis.

      Any thoughts/Ideas/Comments?

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        I forgot to ask what browser users were using. If it's Internet Explorer, this might help solve your problem.

        Comment

        • calexander
          New Member
          • Apr 2008
          • 4

          #5
          We only support IE and we recommend that our client upgrade to IE 7. But as far as I know, all users are using either IE 6 or IE 7. Also the issue is occurring using both IE 6 and IE 7.

          I'm trying to get the numbers for the load on the system at the time of these errors to see if there's a relationship there. On a normal day we peak around 70-75 hits per second, but on bad days we'll peak around 120 - 125. On these days we've seen ColdFusion get out of whack and have to restart itself. It seems like jrun starts using up a lot of memory during that time as well. But I just don’t see what that has to do with form elements? Who knows it might not have anything to do with it, but I guess it’s worth investigating.

          We are building a new web server, upgrading it to IIS 6 and looking at upgrading ColdFusion to see if that helps out. In our development environment it seems to be running a lot faster. Hopefully we'll get that deployed in the next week or two without too many issues. This way we can see if the error still occur on the other web servers and stop on the new one (we'll cross our fingers).

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            It is an old technote, so the issue may affect IE7 too.

            Anyway, good luck with the new servers.

            Comment

            • calexander
              New Member
              • Apr 2008
              • 4

              #7
              So you'd say it's probably an IE issue instead of a CF issue?

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Possibly. You could try the workaround on the server-side (increase or disable the HTTP keep-alive timeout) as explained in the Microsoft KB article.

                Comment

                • D Roger Maves
                  New Member
                  • Feb 2011
                  • 1

                  #9
                  calexander,

                  Did you ever find a solution to this problem. I'm facing the same issue and can't figure it out.

                  Comment

                  Working...