|
|
|
ถ้าเราจะทำให้ dropdown ไม่ให้เลือกซ้ำสามารถทำได้ไหมคะ ทำยังไง |
|
|
|
|
|
|
|
http://jsfiddle.net/5XgLb/
<script src="http://code.jquery.com/jquery-1.8.3.js "></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<script type="text/javascript">
$(document).ready(function(){
$("select.nodup").change(function(){
var curSelection = $(this).attr("for")-1,
curOption = $("option:selected",this).val();
$("select.nodup").each(function(index,value){
if(curSelection != index){
$("option[value='"+curOption+"']",this)
.attr("disabled","disabled");
}
});
});
});
</script>
<select class='nodup' for='1'>
<option>please select</option>
<option value='AAAAA'>AAAAA</option>
<option value='BBBBB'>BBBBB</option>
<option value='CCCCC'>CCCCC</option>
<option value='DDDDD'>DDDDD</option>
</select> <br />
<select class='nodup' for='2'>
<option>please select</option>
<option value='AAAAA'>AAAAA</option>
<option value='BBBBB'>BBBBB</option>
<option value='CCCCC'>CCCCC</option>
<option value='DDDDD'>DDDDD</option>
</select> <br />
<select class='nodup' for='3'>
<option>please select</option>
<option value='AAAAA'>AAAAA</option>
<option value='BBBBB'>BBBBB</option>
<option value='CCCCC'>CCCCC</option>
<option value='DDDDD'>DDDDD</option>
</select> <br />
|
|
|
|
|
Date :
2013-10-16 12:58:06 |
By :
sakuraei |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|