[thelist] help on form submission with javascript - multiple selections

Matthew Fischer mfischer at e-fishsolutions.com
Wed Jan 24 12:34:41 CST 2001


Welcome :)

The problem is while your javascript moves the students from one select list to the other, it doesn't select them, so even though you see them in the second list, the value for that field is still "", so your formmail ignores it. To fix it:

Add the following to the bottom of your javascript:

function selectAll(form) {
   for (var i=0; i < form.Students_to_register.length; i++) {
       if (form.Students_to_register.options[i].value != "") {
            form.Students_to_register.options[i].selected = true }
       }
       
    }



Then change the onClick event for your button "B1" to the following:

onClick="move(this.form.All_students,this.form.Students_to_register);selectAll(this.form)"

Hope that helps.




On 1/24/01 at 5:04 PM, Fintan.Costello at eei.ericsson.se (Fintan Costello (LMI)) wrote:

> Hi there,
> 
> First post to thelist, so be gentle :-)
> 
> See this? http://learning.ericsson.net/fintan/course_booking_form.html
> 
> I'm trying to send this using formmail, no problem with most of it, but the 
> "Students" field is tricky. I've stolen a javascript from somewhere to allow the 
> user move selections from the first selection box to the second, but I can't 
> then get those selections to submit. 
> 
> Anyone hazard a guess as to what I'm doing wrong, or help towards a solution? 
> (Ignore the "Thank you for not filling out this form" bit :) )
> 
> Once the user moves some of the "student 1/2/3" fields to the right hand 
> selection box, how do I get those selections to submit?
> 
> Cheers
> Fintan


_____________________ >}}}}}@> ________________________________
matthew fischer                         toll-free: 877.web.fish
e-fish solutions, inc.                      voice: 203.272.2987
mfischer at e-fishsolutions.com                  fax: 800.203.5816
http://e-fishsolutions.com                   cell: 203.988.5663
__________________________________ <@{{{{{< ___________________




More information about the thelist mailing list