Adam, I am retrofitting someone else's code.. :) There are a lot of other things I am leaving out and this all has nothing to do with colors. What I wrote was a super simplified version of what I am working on. I try not to ask directly for an answer here but use the information given to me from my question to formulate the answer I need. Hope that makes some sense..
Jeff > -----Original Message----- > From: Adam Haskell [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 14, 2005 9:29 AM > To: CF-Talk > Subject: Re: Quick OT Javascript question. PART 2 > > > any reason you are puttting all these into hidden form > values? Why not just build and associative array and use that > to lookuop the rating it will save bandwidth, it will be > valid, and look more professional. The lookup would be the > same AsociativeArrayName[selectedValue] will give you the rating. > > Adam H > > On 6/14/05, Jeff Waris <[EMAIL PROTECTED]> wrote: > > Another question: > > > > In my previous question.. I needed to grab the currently selected > > option from a select list. > > > > I can now get the selected value using this code... > > > > var SelOpt = document.myform.colors.options.selectedIndex; > > var colortype = document.myform.colors[SelOpt].value; > > > > I now need to get the value of a hidden input that is dynamically > > named from the select list value... > > > > Visusally it looks like this... > > > > <select name="colors"> > > <cfloop query="color_names> > > <option value="#name#">#name#</option> > > <input type="hidden" name="#name#" value="#rating#"> > > </cfloop> > > > > I am looking to get the RATING value. > > I can get the selected NAME using the code above, but my > attempts to > > extract the hidden variable have been unsuccessful. > > > > I've tried: > > > > var amt = 'document.myform.' + colortype + '.value'; > > and > > var amt = document.myform.colortype.value'; > > > > I'm stumped.. Any suggestions??? > > > > Thanks, > > Jeff > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209390 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54