RE: Quick OT Javascript question. PART 2
This is prohibited by specs, a select element is not allowed to contain a input element. You might better use either a 2d array -> var tmp [[0,1],[0,1]] or a struct -> var tmp {name:'value',name:'value'} Micha Schopman Project Manager Modern Media, Databankweg 12 M, 3821 AL Amersfoort Tel 033-4535377, Fax 033-4535388 KvK Amersfoort 39081679, Rabo 39.48.05.380 - Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren de interactie met uw doelgroep. Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer informatie zie www.modernmedia.nl - -Original Message- From: Jeff Waris [mailto:[EMAIL PROTECTED] Sent: dinsdag 14 juni 2005 14:02 To: CF-Talk Subject: Quick OT Javascript question. PART 2 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... #name# 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:209398 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
RE: Quick OT Javascript question. PART 2
Yep.. I had to make a couple changes where my hidden list is looped AFTER the Select Option loop but other than that, its similar to what the code looks like. I'll give the document.myform[colortype].value; notation a go... Thanks.. Jeff > -Original Message- > From: Adrian Lynch [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 14, 2005 9:18 AM > To: CF-Talk > Subject: RE: Quick OT Javascript question. PART 2 > > > Yup. Use this notation: > > document.myform[colortype].value; > > From the looks of your code, the generated HTML will look > something like > this: > > > > asas > > > > asasa > > > > asasas > > > > sasasa > > > > Is that ok for you? > > Ade ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209395 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Quick OT Javascript question. PART 2
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... > > > > > > #name# > > > > > > > > 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
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... > > > #name# > > > > 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 > > > ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209387 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Quick OT Javascript question. PART 2
Yup. Use this notation: document.myform[colortype].value; >From the looks of your code, the generated HTML will look something like this: asas asasa asasas sasasa Is that ok for you? Ade -Original Message- From: Jeff Waris [mailto:[EMAIL PROTECTED] Sent: 14 June 2005 14:02 To: CF-Talk Subject: Quick OT Javascript question. PART 2 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... #name# 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:209385 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