I'm trying to pass form information via GET - this is important so that people can send the filtered data from their form selections to other people.
The problem is, using the code below, it not only passes the filter information, but also the submit form value like so: index.php?month_filter=Feb&year_filter=12&Submit=Filter+Table
<form name="filter_form" action="<?php echo CURRENT_PAGE ?>" method="get">
<input name="Submit" type="submit" class="button" value="Filter Table">
Long shot, but is there a way to remove the submit button from the URL? Thanks!
One way to stop form submission is to return false from your JavaScript function.
We use the preventDefault() method with this event to prevent the default action of the form, that is prevent the form from submitting. Example: HTML.
An <input type="submit"> element's value attribute contains a string which is displayed as the button's label. Buttons do not have a true value otherwise.
Submit buttons don't submit if they are not in a form. Not sure why you think form's can't be in a table? (As you already wrote in the title:) The button has no form associated to ....
If you remove the name
attribute, it will not get passed through in GET/POST.
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