Javascript Get Values from Multiple Select Option Box

前端 未结 4 748
我寻月下人不归
我寻月下人不归 2020-11-29 08:38

This one is driving me nuts. It’s got to be something simple and stupid that I am overlooking. I have a multiple select box in a form. I am just trying to get the values th

4条回答
  •  误落风尘
    2020-11-29 08:46

    Also, change this:

        SelBranchVal = SelBranchVal + "," + InvForm.SelBranch[x].value;
    

    to

        SelBranchVal = SelBranchVal + InvForm.SelBranch[x].value+ "," ;
    

    The reason is that for the first time the variable SelBranchVal will be empty

提交回复
热议问题