Thanks Charlie, I still can't seem to accomplish my goal of just being able to have all the contents of the 2nd listbox in one variable that I can call. Even [EMAIL PROTECTED] didn't work for me for some reason?
-----Original Message----- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:25 PM To: CF-Talk Subject: Re: Javascript / Listbox Form Problem Paul: see http://charlie.griefer.com/page1.cfm it's straight JS, so you can easily view the source. I have the onsubmit function returning false just so you can see all of the options in the 2nd <select> box being selected. on page2, it's just form.box2 (which will give you a comma delimited list of all of the options in the <select>). let me know if you have questions. On 5/16/05, Paul Henderson <[EMAIL PROTECTED]> wrote: > Thanks Charlie... > > I would reference the 2nd listbox it's self if I knew how? I'm not sure how > I can reference the elements of the 2nd list box without them actualy being > highlighted or selected when the form is submitted? Please let me know if > you know how to do this, if not I'll try and figure out how to fix that > javascript loop. > > Thanks again. > > > -----Original Message----- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Monday, May 16, 2005 3:58 PM > To: CF-Talk > Subject: Re: Javascript / Listbox Form Problem > > just out of curiousity...why not reference the 2nd list box directly > rather than try and manipulate a hidden form field? > > On 5/16/05, Paul Henderson <[EMAIL PROTECTED]> wrote: > > I'm trying to allow a user to select items from one listbox and add them > to > > a second list box, once the form is submitted the Javascript should set > the > > value of hdnThemes to all the items entered into the second list box > > (lbxSelectedTheme), but of course that is not happening. Any ideas whats > > wrong with the below code or do I need a new approach? Unfortunately since > > taking over this project I have no way of reaching the orginal programmer > > and my javascript skills need some major improvement! > > > > <form id="frmImage" name="frmImage" method="post" > > ENCTYPE="multipart/form-data" action="addimge.cfm?Upload=Yes" > > onSubmit="return VerifyData();"> > > > > <input type="hidden" name="hdnThemes"> > > > > <select name="lbxTheme" size=5> > > OptionA > > OptionB > > OptionC > > OptionD > > OptionE > > /select> > > > > <input type="button" name="btnThemeAdd" value="---->" > > onClick="AddTheme();> > > (The addTheme function is working fine, so I ommitted it to mimimize your > > reading) > > > > <select name="lbxSelectedTheme" size=5> > > <option value='-'>------------------------------------</option> > > </select> > > > > <!----snippet from the VerifyData function that is called OnSubmit ---> > > // Get selected themes > > for (i=1; i< document.frmImageAdm.lbxSelectedTheme.length; i++) { > > if (vThemes == "") { > > vThemes = document.frmImageAdm.lbxSelectedTheme.options[i].value > > } else { > > vThemes = vThemes + "," + > > document.frmImageAdm.lbxSelectedTheme.options[i].value > > } > > } > > document.frmImageAdm.hdnThemes.value = vThemes > > > > Looks like it should be fine, but when I reference Form.hdnThemes it is > > still NULL? > > > > Thanks! > > -Paul > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:206809 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

