You can create input type of hidden and check for its existence:
if (isset($_POST['hiddenName'])) {....}
You can use a hidden field instead. So when the form is submitted, you can check if the hidden element exists.
Like this:
<input type="hidden" name="submit" value="Send Message" />
This way, you can check for $_POST['submit'] when you submit the form. Just make sure the hidden <input> is inside the <form> element, so it will POST with the rest of the form.
You can always hide the submit button (with css display: none
) and click it with JavaScript:
document.forms.theForm.elements.submit.click();
Post a Comment for "Maintain Button Submit Value When Using Link To Submit A Form"