How to write the code To update the selected date value in mysql db & php without refresh the page or redirect to another page [closed]

How to write the code

If I click the edit button it needs to update the selected date value in MySQL DB & PHP without refreshing the page or redirecting to another page
I try this but it not working:

<td>
    <input style="color: black;" name="datef" type="date" id="datef"  value="<?php echo $af['datef']; ?>"> <a class="btn btn-success" href="date.php?id=<?php echo $af['id'];?>&datef=<?php echo $af['datef']; ?>" target="_blank" >edit</a>
</td>

i need to update the value in the date which I have rounded