hello,
I have some ajax requests placed in one page / view.
after I execute ajax above, the ajax below will be executed automatically.
how do I avoid it?
here is my code :
<?php echo CHtml::textField("KreditMemorial",'',array(
'style'=>'width:100px',
'id'=>'KreditMemorial',
'ajax' => array(
'type' => 'POST',
'update'=>'#tabel-memorial',
'url'=>$this->createUrl('transaksi/insertCetakSlip'),
'data'=>array('Kredit'=>'js:this.value',
'Debet'=>'js:document.getElementById("DebetMemorial").value',
'NKP'=>'js:document.getElementById("NKP").value',
'NamaPerkiraanMemorial'=>'js:document.getElementById("NamaPerkiraanMemorial").value',
'Tanggal'=>'js:document.getElementById("TanggalMemorial").value',
'NBA'=>'js:document.getElementById("NBAMemorial").value',
'NamaAnggota'=>'js:document.getElementById("NamaAnggota").value',
'NoBuktiMemo'=>'js:document.getElementById("NoBuktiMemo").value',
'KeteranganMemo'=>'js:document.getElementById("KeteranganMemo").value',),
'success'=> 'function(data) {
$("#tabel-memorial").empty();
$("#tabel-memorial").append(data);
js:document.getElementById("NKP").value="";js:document.getElementById("NamaPerkiraanMemorial").value="";js:document.getElementById("DebetMemorial").value="";js:document.getElementById("KreditMemorial").value="";js:document.getElementById("NKP").focus();
} ',
))
); ?>
<?php echo CHtml::ajaxButton("Baru",$this->createUrl('transaksi/memorialBaru'),
array('type'=>"POST",
'success'=> 'function() {
location.reload();
} ',));?>
<?php echo CHtml::ajaxButton ("Simpan",$this->createUrl('transaksi/memorialSimpan'),
array('type'=>"POST",'success'=> 'function(){
$(".pesanSucces").show("slow").delay(2000);
$(".pesanSucces").hide(1000);
js:document.getElementById("NBAMemorial").value="";
js:document.getElementById("NamaAnggota").value="";
js:document.getElementById("NoBuktiMemo").value="";js:document.getElementById("NBAMemorial").focus();} ',));?>
please help me,