PHP Indonesia - Facebook | PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ | |
 | Book your hotel early for a discount!
You can reap the rewards with great discounts at participating Pullman, M Gallery, Grand Mercure, Novotel, Mercure, ibis and Formule 1 hotels.  | From our sponsors | | |
[Tanya] gan minta tolong gimana ya caranya untuk m... Nov 15th 2013, 09:41, by Fajrul Al-Madyuni | [Tanya] gan minta tolong gimana ya caranya untuk mendelete dengan memunculkan nama yang akan di hapus? <script src="delete_data().js"> </script> <?php echo "<tr bgcolor=\"#B9FFB9\">";?> <?php echo "<td>$no</td>";?> <?php echo "<td>$baris[nama]</td>";?> <?php echo "<td>$baris[user]</td>";?> <?php echo "<td>$baris[pass]</td>";?> <td><a href="delete_member.php?id_member=<?php echo $baris['id_member']?>" onclick='return delete_data(\"member ".$baris ['nama']."\");'>Delete</a> | <a href="edit_member.php?id_member=<?php echo $baris['id_member']?>">Edit</a></td> <?php echo "</tr>";?> <?php $no++; }; }; ?> </table> </body> </html>
ini JSnya gan.... // JavaScript Document function delete_data(nama) { var msg; msg="Kon Kepengen Hapus " +nama+ " ta ?"; var agree=confirm(msg); if (agree) return true; else return false; } |
| | onClick nya itu trap ke variabel this (yang berarti mengacu ke tombol delete nya tersebut), sehingga bisa dilacak via DOM posisi dari td yang memuat nama, posisi relatif nya terhadap td yang memuat tombol delete (biasanya pakai priorSibling atau nextSibling yang diulang-ulang). Nha entar td yang memuat nama itu diambil innerHTML nya, bisa pakai atribut elemen js .innerHTML atau perintah jquery .html(). | | |
|
Tidak ada komentar:
Posting Komentar