Does using <cfselect> rather than a regular select change the id value somehow? The error you're getting would indicate that the element with id "Site_ID" is not found. You might want to use Firefox/Firebug and use "Inspect" to make sure the id is what you think it is.
-- Josh ----- Original Message ----- From: "Bruce Sorge" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Wednesday, April 16, 2008 1:58 PM Subject: Some JS help please >I am using this script: > <cfoutput> > <script type="text/javascript"> > var SiteContact = {}; > var SitePhone = {}; > <!--- Populate Site Contact Information ---> > <cfloop query="qSelectAllSites"> > SiteContact["#qSelectAllSites.SiteID#"] = > '#qSelectAllSites.SiteContact#'; > SitePhone["#qSelectAllSites.SiteID#"] = > '#qSelectAllSites.SitePhone#'; > </cfloop> > > // Listen for changes to the select box > document.getElementById('Site_ID').onchange = function() { > document.getElementById('SiteContact').value = > qSelectAllSites[this.options[this.selectedIndex].value]; > document.getElementByID('SitePhone').value = > qSelectAllSites[this.options[this.selectedIndex].value]; > } > </script> > </cfoutput> > > Everything works OK except for the first document.getElementByID. I am > getting the error message: > > Error: document.getElementById("Site_ID") has no properties > Source File: http://10.120.5.30/tt/Restricted/CaseForm.cfm > Line: 78 > > The select is: > <cfselect name="Site_ID" id="Site_ID" query="qSelectAllSites" > display="SiteName" value="SiteID"></cfselect> > > So what am I missing here? Doesn't the > document.GetElementByID('Site_ID')......... listen for the select list > with the ID Site_ID? > > Thanks, > > Bruce > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303627 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4