I’m trying to get a pop up to work so that when you click on ‘Cancel friendship’ button, it asks you if you’re sure first.
This is the code that controls the cancel function:
echo 'loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove" onclick=" confirmSubmit(); return false;">' . __('Disconnect', 'buddypress') . '';
This is from the bp-friends-templatetags.php file, you can see the ‘onclick’ command I have added.
This is what I have in the head:
var agree=confirm("Are you sure you wish to disconnect from this member?");
return true ;
return false ;
It works, but pressing the ‘cancel’ on the pop doesn’t, it just cancels the friend anyway.
Has anyone got any ideas please?
Thanks very much