to get the value use dd.value
to get the text of the selectIndex use DD.options[DD.selectedIndex].text On Wed, Jan 4, 2012 at 9:03 PM, <[email protected]> wrote: > > Ok I have some code that allows a user to type a word in a cfinput and > then it suggests records from the database in a cfselect that is bound > to that cfinput. Then I need to be able to submit that record using ajax > to insert some data into a database. > > > > The problem comes in when I try to reference the items in the cfselect > drop down by using the JavaScript for getting the value of the selected > record like so > > > > var DD = document.getElementById("ItemNameB"); > > DD.options[DD.selectedIndex].value > > > > When I try this and submit it I get the error > > > > "Index or size is negative or greater than the allowed amount" > > > > It seems as if the JavaScript cannot access the records brought in from > the database after the bind. Can anybody confirm this? Have a suggestion > for a different way to get that value? > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349315 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

