How to check if submit button is pressed with these form parameters:

<form method="post" action="options.php">
  • if the button is pressed, you will find its name in $_POST
    – mmm
    Commented Apr 29, 2017 at 13:09

1 Answer 1


You question is not well explained, what you want to achieve, here is the suggestion,

you can add JS event ONClick into you submit button and define the JS function according to your goals, (for example you want to count submit button click)

<script type="text/javascript">
var clicks = 0;
function onClick() {
    clicks += 1;
    document.getElementById("clicks").innerHTML = clicks;
<form method="post" action="options.php">
<button type="button" onClick="onClick()">Submit</button>
<p>Clicks: <a id="clicks">0</a></p>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.