I have a popover that lists various playlists a user has. On click, I am trying to get the video_id associated with the video to be added to the appropriate playlist. I'm not sure how to implement this; the user clicks on the link in the popover, the video_id (from the div #add) and the playlist selected (there are multiple playlists that the user generates names for but only one is selected) is supposed to be extracted. Any advice?
<script type="text/javascript">
$(document).ready(function() {
$("#muncher").click(function(event){
event.preventDefault();
$.ajax({
type:"POST",
url:"/edit_favorites/",
data: {
'video_add': $('#add').val(), // from form
'playlist_selected': $('#').val() //from form
},
success: function(){
$('#muncher').html("Added");
}
});
return false;
});
});
</script>
<div id = 'muncher'>
<div id = 'add'>12345</div>
<a href = "#" id="munch" rel="popover" data-html="true" data-placement="right" data-content= "<a href= '#'>Favorites</a><br>
<a href = '#' class = 'Funny'>Funny</a><br>
<a href = '#' class = 'test'>test</a><br>
<a href = '#' class = 'test1'>test1</a><br>
" data-original-title="Add to your plate">
Munch
</a>
</div>