[Answer]-Is jQuery passing the correct variable to my Django view?

1👍

You are saving the id to the variable id

var id = $(this).attr('id');

but you are sending the variable entryname (which does not exist so is undefined)

data: { entryname:entryname },

What you want it:

data: { entryname: id },

Update

You are also missing a "

 entry.name <div class="delete_button" id="{{ entry.name }}">delete</div>

0👍

You have

data: { entryname:entryname },

but no entryname variable defined. there is an id variable defined. Maybe it should be

data: { entryname:id },
👤Musa

Leave a comment