|
|
|
พอเปิดหน้ามา ก็ให้เช็คค่า ของ check box ถ้าไม่มีการ checked ก็ไม่ต้องโชว์ข้อมูล จะแก้โค้ดอันนี้ยังไงคะ JQUERY |
|
|
|
|
|
|
|
Code (PHP)
$cols = array(
"aa"=>"Column AA",
"bb"=>"Column BB",
"cc"=>"Column CC",
"dd"=>"Column DD",
"ee"=>"Column EE",
"ff"=>"Column FF",
"gg"=>"Column GG",
"hh"=>"Column HH",
"ii"=>"Column II",
);
Code (JavaScript)
<script type="text/javascript">
$(document).ready(function toggle(id){
eval("if($('#" + id + "').is(':checked')){ $('td[abbr=\"" + id + "\"]').show(); }else{ $('td[abbr=\"" + id + "\"]').hide(); }");
});
</script>
Code (PHP)
echo '<input type="checkbox" id="' . aa . '" checked="checked" onclick="toggle(\'' . aa . '\')" /><label for="' . aa . '">Column AA</label><br/>' . "\n";
echo '<input type="checkbox" id="' . bb . '" checked="checked" onclick="toggle(\'' . bb . '\')" /><label for="' . bb . '">Column BB</label><br/>' . "\n";
echo '<input type="checkbox" id="' . cc . '" checked="checked" onclick="toggle(\'' . cc . '\')" /><label for="' . cc . '">Column CC</label><br/>' . "\n";
echo '<input type="checkbox" id="' . ii . '" onclick="toggle(\'' . ii . '\')" /><label for="' . ii . '">Column II</label><br/>' . "\n";
Tag : PHP, MySQL, HTML/CSS, JavaScript, jQuery
|
|
|
|
|
|
Date :
2010-12-06 14:35:14 |
By :
unzeen |
View :
1027 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ต้องการใส่ default ให้มันใช่ไหม
|
|
|
|
|
Date :
2010-12-07 07:16:27 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|