its good to delete api using js auto submit button form method="post" when action="/data/delete/%id%" button id="autosubmit" think of using rule to disable code when data api file delete success <*script type="text/javascript">
function submit2()
{
document.submitForm2.submit2(); // Submits the form without the button
}
setTimeout(function submit2(){ document.getElementById("autosubmit").click() }, 0000);
<*/script>