I Want To "intercept" A Delete Button Press September 27, 2022 Post a Comment I would like to 'intercept' a delete button press - I believe this is possible with Javascript? I don't know the exact terminology. Here's my code: type="submit" name="del" value=' . stripslashes($cultrow["cult_id"]) . '>Del</button></td> Copy Solution 2: Without any JavaScript framework, the simplest thing would be to add an onclick attribute onclick="return confirm('Are you sure?');" Copy Note that your PHP code should read <button type="submit" name="del" value="' . htmlspecialchars(stripslashes($cultrow["cult_id"])) . '">Del</button> Copy To avoid cross-site scripting vulnerabilities you must always HTML-escape any data you output to the page. You are also missing the double quotes at the value attribute. Share Post a Comment for "I Want To "intercept" A Delete Button Press"
Post a Comment for "I Want To "intercept" A Delete Button Press"