<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="keywords" content="design, css, rss, ajax, xml, design, usability, information architecture, flash, ria" />
<meta name="description" content="" />
<meta http-equiv="imagetoolbar" content="no" />
<title>arc90 lab | tools: jQuery MultiSelect</title>
<style type="text/css">
/* Style for this page */
            @import "style.css";       
        </style>
        
        <!--[if lt IE 7]>
        <style type="text/css">
        /* Overrides for IE */        
        .multiSelect div.title {
            position: absolute;
            z-index: 104;
            width:100%;   /* Fix for IE. */
        }      
        
        </style>
        <![endif]-->
        <!--[if lt IE 6]>
        <style type="text/css">
        .multiSelect div.title
        {
            height: 20px; /* Fix for IE. */
        }
        </style>
        <![endif]-->

        <script language="javascript" type="text/javascript" src="jquery-latest.js"></script>
     <script language="javascript" type="text/javascript" src="arc90_multiselect.js"></script>
<script language="javascript" type="text/javascript">
$(function() {
            $('#basicmultiselect').multiSelect({select_all_min: 3});
            $('#lang').multiSelect({
                                select_all_min: 3,
                                no_selection: "Please select a few items!",
                                selected_text: " clicked%%%%%%%%%%%"
                               
                               });
            $('#methods').multiSelect();
});

function doSubmit()
{
window.location="sms.action";

}
</script> </script>
</head>
<body>

<div id="container">

<h1>jQuery MultiSelect</h1>
<form action="#" method="get" name="form" id="form">
            
            
  <div class="examples">
<label class="examples">First example of jQuery MultiSelect</label>
    <select id="lang" name="lang" class="arc90_multiselect" multiple="multiple" title="Languages">
                  <option value="fr">French</option>
                  <option value="en" selected="true">English</option>
                  <option value="sp">Spanish</option>
                  <option value="jp" selected="true">Japanese</option>
                </select>
  </div>
             <input type="button" onclick="doSubmit()">
</form>


</body>
</html>
那么如何在sms.action中得到其选中的值呢。。如图片所示:

解决方案 »

  1.   


    function doSubmit()
    {
    document.form.action="sms.action";}
    这个插件应该会提供获得选中数据的方法,不过jquery也行。
    window.location = "sms.action?lang=" + $("#lang :selected").val();
    如果是多个就是数组
    var lang = "";
    $("#lang :selected").each(function () {
         lang += $(this).val() + ",";
    });
    window.location = "sms.action?lang=" + lang;
    在action中用request.getParmenter("lang");
      

  2.   

    和jquery的函数没有什么区别,截取action的字符串