1👍
✅
Use javascript to pass the needed id to your modal window.
Is there some button in your cycled items to choose the item? Render an item id within a cycled item, bind onclick event to the button and pass the item id to the modal window hidden input.
0👍
Thanks for help!!!
i’m do this)))
Here is code, in case if needed someone)
script :
<script>
function PopUpShow4(id){
document.getElementById('id_get_post_id').value=id;
$("#popup4").show();
$(document).keyup(function(ev){
if(ev.keyCode == 27)
$("#popup4").hide();
});
}
function PopUpHide4(){
$("#popup4").hide();
}
</script>
MODAL WINDOW:
<div class="b-popupdel" id="popup4" >
<div class="b-popup-contentdel">
<form action="" method="post">{% csrf_token %}
<p><center><font color=#000000 size="5"><b>Confirm Delete</b></font></center></p>
<input id="id_post_request" value="2" type="hidden" maxlength="1" name="post_request" type="text">
<center><p><font size="2">Are you sure you want to delete this post?</font></p></center>
<input id="id_get_post_id" id_get_post_id" type="hidden" maxlength="9999" name="get_post_id" type="text">
<center><input type="submit" value="Remove" style="height:30px; width:80px">
<input type="button" value="Cancel" ONCLICK="PopUpHide4()" style="height:30px; width:80px" ></center>
</form>
</div>
</div>
calling modal window :
<div style="width:5%; float:right;">
<div id="b-container">
<a href="javascript:PopUpShow4({{ item.id }})"><div class="photo" data-title="Remove"><input type="image" src="{{ STATIC_URL }}images/delete.png" border="0" width="17" height="17" ></div></a>
</div>
</div>
- [Answer]-Django rest framework OAuth2 Toolkit
- [Answer]-Django Multiple many-to-many through
- [Answer]-Create friends list between users in django web application
Source:stackexchange.com