Answers for "confirm box with onclick event in php"

PHP
1

click confirm before submit form php

<form action="adminprocess.php" method="POST" onsubmit="return confirm('Are you sure you want to submit this form?');">
    <input type="submit" name="completeYes" value="Complete Transaction" />
</form>
Posted by: Guest on February-06-2021
2

php confirm box

If you want to do this only in PHP, you will need to add "steps" in your script, like:

step1 (show form) -> step2 (ask validation) -> step3 (validate)
To do so, you can use sessions to keep form content, and GET parameter to track the step. Otherwise the simplest solution is to use javascript:

echo "<td><a onClick=\"javascript: return confirm('Please confirm deletion');\" href='delete.php?id=".$query2['id']."'>x</a></td><tr>"; //use double quotes for js inside php!
Posted by: Guest on July-13-2021

Browse Popular Code Answers by Language