Skip to main content

cara nampilin konfirmasi pada CI

6 replies [Last post]
does not have a status.
edwar's picture
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 07/12/2011

Agan-agan, mohon mnta bntuannya nih.
bgaimna cara nampilin konfirmasi di CI saat button "hapus" diklik?
misalnya mau ngehapus daftar kryawan, kemudian saat button hapus tersebut di klik maka akan keluar konfirmasi "yakin mau di hapus" . mhon bntuannya, trimakasih . . .

now... what????
zawaruddin's picture
User offline. Last seen 3 days 6 hours ago. Offline
Joined: 02/28/2011
klo g pake jquery, bisa pake

klo g pake jquery, bisa pake js langsung....

<script>
function check(thisform){
  with(thisform){
    if(confirm('apakah anda yakin untuk menghapus data "'+nama.value+'"?')){
      return true;
    }else{
      return false;
    }
  }
}    
</script>
 
<form action="test.php" onsubmit="return check(this)">
nama : <input type="text" name="nama" value="test">
<input type="submit" value="submit">
</form>

------------------------------------------------------------
Go..Go..Go.. CodeIgniter

Visit My Blog @ zawaruddin.blogspot.com

does not have a status.
novinaldi's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 04/05/2011
klo saya nggak pake javascript mas

cuman pake input button ja, gini script code nya :

mudah2an membantu........

does not have a status.
edwar's picture
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 07/12/2011
w?

maf mas source-ny ga ada tuh . . .
tlong dibantu y . .

does not have a status.
novinaldi's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 04/05/2011
klo saya nggak pake javascript mas

cuman pake input button ja, gini script code nya :

does not have a status.
predhtz's picture
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 01/07/2010
Pake Javascript

pake javascript bro....
contoh kalo pake jquery gini...

<script>
$(document).ready(function(){
$(".delete").click(function(){
var message = "Yakin Mau Dihapus?";
if (confirm(message))
{
location.href=$(this).attr("href");
}
return false;
});
});
</script>
<a href="hapus/id/1" class="delete">Hapus</a>

does not have a status.
edwar's picture
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 07/12/2011
dicopy

okeyyy, jquery-nya di copy dulu.
maksih solusinya gan...

Premium Drupal Themes by Adaptivethemes