JavaScript Not found when using ajax in dynamic dropdown in php found using wooded kingdom art,found using rox spray underpass,

In my php code, I have two dropdowns which is the other one depends on the first one.

Here is the first dropdown:

<select class="form-control style" id="sel" >
    <option style="color: black;" >Select...</option>
    <?php foreach ($dtype as $row ) { ?>
    <option style"color:black;" value="<?php echo $row['donations_type_id'];?>"> <?php echo $row['donations_type_name'];?></option>
    <?php }?>                               
</select>  
<tr>
<td>Available Donation:</td>
<td style="color: black; ">
    <select name='avail' id='avail' class="form-control style" >
        <option style="color:black;" value="">Select...</option>                    
    </select>   
</td>
</tr>

The second dropdown shows the data that corresponds whatever the user selects from the first dropdown.

Here's the script:

<script type="text/javascript">
$(document).ready(function(){
$("#sel").change(function(){  
    $.ajax({         
    data: {id: $(this).val()},  
    type: "POST",  
     url:"<?= base_url() ?>BeneficiaryModule/showAvailable/"+ $(this).val(),  
    success:function(data){  
    $("#avail").html(data);  
    }       
   });  
});
});
</script>

In my controller:

public function showAvailable()
    {
    echo $id = $this->input->post('id', true);
    $data['package'] = $this->Beneficiary_model->getDtype($id);
    $output = null;
    foreach ($data['package'] as $row ) {
        $output.="<option value='".$row->package_id."'>".$row->package_name."</option>";
    }
    echo $output;        
}

And in my model:

public function getDtype($id){
    $this->db->select('package_id','package_name');
    $this->db->from('package_table');
    $this->db->where('package_type', $id);
    $query = $this->db->get();
    return $query->result();
}

When I tried to run the code and debug it through F12, it shows there that POST http://localhost:8999/samp/sampModule/showAvailable/2 404 (Not Found)

Why is it?

Can anyone help me with this error?

Answer:1

I need to create an empty JQuery element to be the outer scope list of a loop, for example : const forms_data = ['Name', 'Email']; const form = $(); for (const input_name of forms_data){ form....

I need to create an empty JQuery element to be the outer scope list of a loop, for example : const forms_data = ['Name', 'Email']; const form = $(); for (const input_name of forms_data){ form....

  1. create empty jquery object
  2. create empty jquery array
  3. create empty jquery collection
  4. create empty jquery element
  5. create empty jquery
  6. create empty div jquery
  7. create empty datatable jquery
  8. create empty list jquery
  9. jquery create empty json object
  10. jquery create empty array and push
  11. jquery create empty dom element
  12. jquery create empty selector
  13. jquery create empty variable
  14. jquery create empty selection
  15. jquery create empty object array
  16. jquery create empty html element
  17. jquery create empty promise
  18. jquery create empty json
  19. jquery create empty guid
  20. jquery create empty attribute

I've been searching for the answer to this question but have so far been unable to piece together the answer. Please explain any answer you have in really simple terms as I'm fairly new to GAS and ...

I've been searching for the answer to this question but have so far been unable to piece together the answer. Please explain any answer you have in really simple terms as I'm fairly new to GAS and ...

  1. regex replace tag html
  2. regex replace tags
  3. regex replace html tags c#
  4. regex replace html tags javascript
  5. regex replace script tags
  6. regex replace between tags
  7. regex replace style tags
  8. php regex replace tags
  9. regex replace all tags
  10. regex replace html tags except
  11. regex replace anchor tags
  12. javascript regex replace tags
  13. python regex replace tags
  14. regex replace xml tags
  15. c# regex replace tags
  16. regex replace br tags
  17. java regex replace tags
  18. regex replace html tags java
  19. regex replace href tags
  20. regex replace img tags

My first time posting on here so hopefully I do this correctly! Here's sample code: $(document).ready(function() { $('[data-toggle=offcanvas]').click(function() { $('.row-...

My first time posting on here so hopefully I do this correctly! Here's sample code: $(document).ready(function() { $('[data-toggle=offcanvas]').click(function() { $('.row-...

OK, so I'm trying to take an image on my machine and manipulate it using a canvas and some JS... However, I keep getting the error: "Image from origin 'file://' has been blocked from loading by ...

OK, so I'm trying to take an image on my machine and manipulate it using a canvas and some JS... However, I keep getting the error: "Image from origin 'file://' has been blocked from loading by ...