私はjavascript関数に値idを渡します。idは印刷しています。javascriptからcodeigniterのブートストラップモデルにidを渡す方法は?
<script>
function openModal(id) {
document.getElementById('myModal').style.display = "block";
var img_id = id;
document.getElementById('caption').innerHTML = img_id;
}
</script>
が、今私は、ブートストラップモーダル
<div id="myModal" class="modal">
<button type="button" id="close" onclick="closeModal()">close</button>
<div class="modal-content">
<div class="mySlides">
<?php
//here i want to use this id with if condition so that desired image is
//displayed.With for each all images are coming.
//$project_images = explode(",", $value['project_gallery']);
$project_images = json_decode($value['project_gallery'],true);
foreach ($project_images as $project_image_value) {
?>
<img src="<?= base_url() ?>assets/uploads/projects/<? =$project_image_value['fname']?>" style="width:100%">
<?php
}
?>
</div>
</div>
</div>
にこの値を渡したいそれはそう私に知らせて.IF可能です。
あなたはもっと具体的になることができますか? – user218046
私はモデルで使用するように、javascript関数からimg_idをブートストラップモデルに渡したい –
正確にそのIDをモデルにしたいですか? – user218046