Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).on('change', '#cnt_code', function() {
- $.ajax({
- url: '<?php echo base_url().$directory; ?>/get_detail_contact/',
- type: 'get',
- data: {"cnt_code" : $('#cnt_code').val()}
- dataType: 'json', //define datatype ne coba
- }).done(function (data) {
- $.each(data, function (index, value) {
- console.log(value);
- });
- off(); //bak test di console ape pesu?
- // ini nanti ngisi ke masing2 form field
- var obj = jQuery.parseJSON(data); // obj ini hasilnya
- alert(obj.cnt_first_name); // ini nggak mau muncul fieldnya, hasilnya malah undefined
- }).fail(function() {
- alert('fail');
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement