|
 |
|
JavaScript เช็คค่าว่าสมมุติมี checkbox อยู่ห้าชุด หลังจากกดปุ่ม submit ถ้าผู้ใช้ไม่เลือกให้ครบทั้งหมด |
|
 |
|
|
 |
 |
|
Code (PHP)
<pre>
<input type="checkbox" value="1"> 1
<input type="checkbox" value="2"> 2
<input type="checkbox" value="3"> 3
<input type="checkbox" value="4"> 4
<input type="checkbox" value="5"> 5
<input type="checkbox" value="6"> 6
<button type="button" id="btn">Check</button>
</pre>
<script src="jQuery-1-10-1.js"></script>
<script>
$(function(){
$('#btn').on('click',function(){
$(':checkbox').each(function(index, element) {
if($(this).prop('checked') == false){
alert('Please you checked '+$(this).val());
}
});
});
});
</script>
|
 |
 |
 |
 |
Date :
2014-03-28 10:10:09 |
By :
Ex-[S]i[L]e[N]t |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จาก #NO 5 ผมเกิดมาโชคดีครับ (พกบุญมาเกิด)
ผมถึงมีความสุขมากกว่าใครบางคน เพราะ ผมไม่ได้เป็นผู้เชี่ยวชาญ
    
|
 |
 |
 |
 |
Date :
2014-03-28 11:49:07 |
By :
love9713 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|