Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var base_url = "<?php echo base_url();?>";
- $(document).ready(function() {
- $('select[name="make"]').on('change', function() {
- var makeid = $(this).val();
- if(makeid) {
- $.ajax({
- url: base_url + 'myform/ajax/'+makeid,
- type: "GET",
- dataType: "json",
- success:function(data) {
- $('select[name="model"]').empty();
- $.each(data, function(key, value) {
- $('select[name="model"]').append('<option value="'+ value.id +'">'+ 'salam' +'</option>');
- });
- }
- });
- }else{
- $('select[name="model"]').empty();
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement