Sebuahhobi98

contoh session ajax

Jan 22nd, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. function session()
  2. {
  3. $this->session->set_flashdata('pembayaran', $_POST['pembayaran']);
  4. }
  5.  
  6. $("#npm").change(function(){
  7.  
  8. var value=$(this).val();
  9. //if(value>0){
  10. $.ajax({
  11. data:{modul:'ikhwan',id:value},
  12. success: function(respond){
  13. //$("#jumlah_pembayaran").val(respond);
  14. if(respond>0){
  15. $.post("<?php echo site_url();?>/select/session",{'pembayaran':respond});
  16. var output2= "Rp. " + parseInt(respond).toLocaleString();
  17. $("#jumlah_pembayaran").attr("placeholder", output2);
  18. $("#save").removeAttr("disabled");
  19. }
  20. else{
  21. var output1="NPM salah!";
  22. $("#jumlah_pembayaran").attr("placeholder", output1);
  23. $("#save").attr("disabled");
  24. }
  25.  
  26. }
  27. })
  28. //}
  29.  
  30. });
Add Comment
Please, Sign In to add comment