我正在使用这个双列表框插件,我正在尝试使用从 box1 到 box2 中选择的 jQuery 的 onClick 事件来获取值,
这是我正在使用的代码
<form action="" method="post" class="form" id="purchaseEditUpdateItemForm">
<div class="widget">
<div class="title">
<img src="/images/icons/dark/full2.png" alt="" class="titleIcon" />
<a href="#" class="button blueB" id="purchaseEditUpdateItemBtn" style="margin: 4px;">
<span>Update</span>
</a>
</div>
<div class="body">
<div class="leftPart">
<div class="filter">
<span>Filter:</span>
<input type="text" id="box1Filter" class="boxFilter" />
<input type="button" id="box1Clear" class="fBtn" value="x" />
<div class="clear"></div>
</div>
<select id="box1View" multiple="multiple" class="multiple" style="height:200px;">
<option value="5">ITEM005</option>
<option value="6">ITEM006</option>
<option value="7">ITEM007</option>
<option value="8">ITEM008</option>
</select>
<br/>
<span id="box1Counter" class="countLabel"></span>
<div class="dn">
<select id="box1Storage" name="box1Storage"></select>
</div>
</div>
<div class="dualControl">
<button id="to2" type="button" class="basic mr5 mb15"> > </button>
<button id="allTo2" type="button" class="basic"> >> </button>
<br />
<button id="to1" type="button" class="basic mr5"> < </button>
<button id="allTo1" type="button" class="basic"> << </button>
</div>
<div class="rightPart">
<div class="filter">
<span>Filter:</span>
<input type="text" id="box2Filter" class="boxFilter" />
<input type="button" id="box2Clear" class="fBtn" value="x" />
<div class="clear"></div>
</div>
<select id="box2View" multiple="multiple" class="multiple" style="height:200px;">
<option value="1">ITEM001</option>
<option value="2">ITEM002</option>
<option value="3">ITEM003</option>
<option value="4">ITEM004</option>
</select>
<br/>
<span id="box2Counter" class="countLabel"></span>
<div class="dn">
<select id="box2Storage"></select>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</form>
我正在尝试类似的东西?(我知道下面的代码不实用)
$('#purchaseEditUpdateItemBtn').live('click', function(){
var formData = $('#purchaseEditUpdateItemForm').serialize();
});