ColdFusion.getElementValue returns wrong value

Posted At : September 13, 2007 6:38 AM | Posted By : Dave
Related Categories: ColdFusion 8

I ran in to an interesting issue that I at first thought was a browser issue. I was using ColdFusion.getElementValue to get the value from a hidden form field. The form in question was inside a CFWINDOW created using ColdFusion.window.create.

Lets assume the value of the hidden field is "123". When the window opens and I get the value the return is accurate. However, if I close the window then open it again the value retrieved is not accurate. Subsequent close and opens of the window make the problem even worse. Every close and open of the window appends the value to the previous to make a delimited list of values. So, if the window was closed and opened 3 times I would end up with "123,123,123" as the return in FireFox. However, do the same in IE and I get "123,,".

Now, if I get the value using document.getElementById('hiddenfield').value the return is always accurate. This tells me it is not the browser but something with CF's javascript function to get the value. I have not verified this but I am quite certain it is some form of caching going on inside the browser. It seems strange to me as to why this type of thing would be cached. It makes it very hard to use in a dynamic enviornment.

--Dave

Related Blog Entries

Comments
Dave,
Thanks for finding this issue. I have logged a bug for this and will fix the issue soon.

Thanks,
Rakshith
Adobe ColdFusion Team
# Posted By Rakshith | 9/13/07 10:13 PM
Hi Dave,

I am unable to reproduce this behavior (using CF8 final) using the exact scenario you outlined. Could you please attach/send a reproducible case?
# Posted By Vamsee | 9/14/07 3:21 AM
Hi Dave,

Could you please send a repro case for this so that we can follow it up? The bug number for the bug logged against this issue is 70478.

Thanks,
Vamsee
Adobe ColdFusion Team
# Posted By Vamsee | 9/24/07 1:34 AM
The code I have that does this I can not share. I am working on extracting the code to make a reproducible case. I will post it as soon as I get it.

--Dave
# Posted By Dave Ferguson | 9/25/07 9:28 AM
has anything been done on this issue? or have you been able to find a fix for it.
Its become a heavy roadblock in development of our CRM

-Hopefully
# Posted By Brandon Wittwer | 10/15/07 6:47 AM
I have posted another blog entry that has sample code to duplicate this issue.

http://www.dkferguson.com/BlogCFC/index.cfm/2007/1...

--Dave
# Posted By Dave Ferguson | 10/17/07 6:53 AM
begendim guzel olmus kutlarim ellerinize saglik.
# Posted By Oyun | 7/7/08 12:37 AM
I'm guessing the only way to do this in Javascript would be to use the onresize event, and then using the resizeTo method to attempt to keep the window at the size you want?
# Posted By Estetik | 11/16/08 8:21 AM
For those of you thinking that if they implement this it will eliminate some of the waiting and lines…
# Posted By Gogus Estetigi | 11/22/08 8:24 PM