(01-20-2018, 10:16 PM)skunkbad Wrote: (01-20-2018, 08:20 PM)reesethebeast Wrote: Thanks Skunkbad. I have the same code but it currently is not updating the hidden input field value. I modified the Auth form helper to include ID on the hidden token field as there was just name previously. This still did not do the trick but once I get this working I should be set.
Code:
$(document).ready(function(){
$(document).on("click","#delete_bookmark",function(a){
a.preventDefault();
var b=$(this).attr("bookmark_id"),
c=$(this).closest("tr"),
d=$("input[name=token").val();
$.ajax({type:"POST",
url:"deletebkmark",
data:{token:d,bookmarkid:b},
dataType:"json",
success:function(a){
if (a.status == 'X')
{
$("#token").val(a.new_token);
$("#list_count").html(a.count);
c.remove();
}
else
{
alert("Error occurred. Please contact support.");
}
}
})
}),
})
Any chance that the "a" var has some sort of conflict because you have 2 "a"s ?? One is on your click event, and the other is your AJAX response data.
Hmmm, wow, I guess that was it. Good catch. The JS minification changed the variable names. This is working now. Thanks for all of your help.