Status konfirmasi event delete dengan onclick javascript

Bintaro – Status konfirmasi saat mau delete record awalnya gw gunain cara yang ribet pake banget, sebelom gw tau ada Onclick Event nya javascript. Bikin div yang statusnya none (ngumpet), didalem div yg ngumpet itu ada form buat delete. Nah di button delete itu gw bikin fungsi jQuery yg manggil (mode pop up) n baru deh setujuin untuk di delete recordnya… Udah selesai? Belom!! Pan kudu dibikin lagi fungsi ngumpetin itu div 😀

Nah ternyata javascript udah ada event yg ga bikin ribet konfirmasi saat mau ngedelete. Simple, sisipin aja event onclick=”” di dalem button diikuti sama confirm(‘isi keterangannya’) method. Jadinya tag button itu jadi

<button type=”submit” name=”del_tgl” onclick=”return confirm(‘Are you sure want to delete this record?’);”>delete</button>

Done!! Semoga bermanfaat 🙂

About the Author

Anshori Wahyu
My name is Mas Wahyu Anshori, 32 years old. I am a student from STIE Ahmad Dahlan Jakarta, work at Punakawan Digital Media since Oct 2017. Before I came to Punakawan, I was doing IT Supportt and web content at Seratus Company, Melodia Group and be part of Kehati as a freelance web developer. I was also a freelance web developer with simple HTML, CSS base, jQuery, and PHP. Learned Website Developer base (with a help of Google) by myself would be my achievement so far. I'am an Indonesian football junkie, as well as addicted to HTML, CSS and jQuery coding.

Be the first to comment on "Status konfirmasi event delete dengan onclick javascript"

Leave a Reply