469,349 Members | 1,596 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,349 developers. It's quick & easy.

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:

Expand|Select|Wrap|Line Numbers
  1. <td>$<input type=text name="targprice" value="#Trim(NumberFormat(targprice,'999999.99'))#" tabindex="6" id=numberinput size="9" onFocus="select();" onBlur="doFormatCurrency(this);"></td>
  2.  
  3. <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?
Apr 8 '08 #1
8 5607
acoder
16,027 Expert Mod 8TB
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?
Apr 9 '08 #2
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?
Apr 9 '08 #3
acoder
16,027 Expert Mod 8TB
I forgot to ask what browser users were using. If it's Internet Explorer, this might help solve your problem.
Apr 10 '08 #4
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).
Apr 10 '08 #5
acoder
16,027 Expert Mod 8TB
It is an old technote, so the issue may affect IE7 too.

Anyway, good luck with the new servers.
Apr 10 '08 #6
So you'd say it's probably an IE issue instead of a CF issue?
Apr 10 '08 #7
acoder
16,027 Expert Mod 8TB
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.
Apr 11 '08 #8
calexander,

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

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Martin O'Rourke | last post: by
1 post views Thread by Stanimir Stamenkov | last post: by
6 posts views Thread by Luke Dalessandro | last post: by
8 posts views Thread by bennett.matthew | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.