Put an Alert inside the for loop and alert vTheme.
Also use Mozilla's script debugger :)
I'd also do it like this:
// Get selected themes
var vThemes = []; //note vThemes is now an array
for (i=1; i< document.frmImageAdm.lbxSelectedTheme.length; i++) {
vThemes.push(document.frmImageAdm.lbxSelectedTheme.options[i].value);
alert(vThemes);
}
document.frmImageAdm.hdnThemes.value = vThemes.join();
Adam H
On 5/17/05, Paul Henderson <[EMAIL PROTECTED]> wrote:
> As far as I know it is running, I do not receive any browser errors I'm not
> sure how else to tell if it is actually running or not.
>
> -----Original Message-----
> From: Adam Haskell [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 17, 2005 2:13 PM
> To: CF-Talk
> Subject: Re: Javascript / Listbox Form Problem
>
> Is this function executing without error. Javascript will fail
> silently and just allow the form to submit. Maybe its not running?
>
> Adam H
>
> On 5/17/05, Paul Henderson <[EMAIL PROTECTED]> wrote:
> > Thanks Adam and Rebecca for the response, Adam I do have the listbox set
> up
> > to allow multiple selections:
> >
> > <select name="lbxSelectedTheme" multiple size=5>
> >
> > But because the user is adding items from one listbox into another, at the
> > time the form is submitted the items are not selected.
> >
> > Apparently this code I'm trying to work with has worked properly in the
> > past, it sure won't work for me.
> >
> > // 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
> >
> > Despite this above code, hdnThemes is always NULL when I try to reference
> > it, but maybe because OnSubmit hdnThemes is passed as NULL however, this
> > function SHOULD update it's value.
> >
> > Thanks again for all the help, hopefully you can find your past code Adam.
> >
> > -Paul
> >
> >
> > -----Original Message-----
> > From: Adam Haskell [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, May 17, 2005 1:28 PM
> > To: CF-Talk
> > Subject: Re: Javascript / Listbox Form Problem
> >
> > I'll search for my page that does that but the gist of it is move the
> > items over then select all items onSubmit. The key to getting this to
> > work is make sure the second select box has the ability to select
> > multiple items.
> >
> > Adam H
> >
> > On 5/17/05, Rebecca Wells <[EMAIL PROTECTED]> wrote:
> > > I don't think that's possible. I have built pages that have the multiple
> > select option. What you have to do is submit the selected items from the
> > list1 to the action page (using an "Add" or "-->" button), which inserts
> > eacho of the selected items to a db table, then return to the display page
> > with the selected items added to, or subtracted from, the list2. The user
> > can use a "Delete" or "<--" button to remove selected items from list2,
> and
> > it works the same way as the add button. They make their choices from
> list2,
> > select the Delete button, which submits to the action page, detects that
> the
> > Delete button was selected and loops over the list2 form members, deleting
> > them from the db table, and returns to the display page showing those
> items
> > gone from list2. Yes, that may seem like a lot of work, but I haven't
> > figured out any simpler way to do this kind of user interface. I hope that
> > makes sense.
> > >
> > > >It seems to only output the value if an item has been selected, but my
> > goal
> > > >is to on one submit get the value of everything that's been added to
> the
> > > >list box?
> > >
> > >
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:206914
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