I have a long form with a submit button that sends the values of all the fields into the address bar.
However, I want the submit button to ALSO add an extra value (&submitted=yes) when it is clicked.
How can I convert my button:
<input type="submit" name="submitted" value="submit">
to do this?
The idea is that I could then use that value in javascript when the page loads along with the other fields:
<script language="javascript">
var urlParams = new URLSearchParams(window.location.search);
var LastName = urlParams.get('LastName');
var Submitted = urlParams.get('Submitted');
Easiest solution: add a hidden input field to your form.
<input type="hidden" name="submitted" value="yes">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With