php - Convert my Javascript to Ajax -
im having hard time figuring out on how can convert javascript code ajax everytime ill click on link, details of view change. thanks
example: if ill select crop modal pop out details of specific crops.
here js file
$(document).on("click", ".fetchccropid", function () { var myccropid = $(this).data('id'); alert(myccropid); console.log(myccropid); $(".modal-body #crop_cultivated_id").val(myccropid); });
and receiving end one:
<input type="text" name="crop_cultivated_id" id="crop_cultivated_id" value="0" /> <?php $q_update_cc = $this->db->query("select * cultivated_crops cc_id=".$cc_id_from_js ) ?>
there no problem when pass myccropid textbox. problem when i'll pass myccropid value php can query.
i dont know how pass value js php $cc_id_from_js have value. i'm thinking if there possible way pass value without using ajax.
thanks in advance helping
Comments
Post a Comment