I am kinda confused on it, when trying to send value on the same page.
Here is the working code for you. To send ajax request to the same page you can keep url parameter empty, which you are already doing. If you are trying to make the script behave differently when $_POST has value then use isset as I have used below.
url
$_POST
isset
Chocolate Candy Taffy Caramel Fudge Cookie