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="----&gt;"
> 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
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:206792
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

Reply via email to