Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop the 'submit' button value from being passed via GET?

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!

like image 628
xn dx Avatar asked Jan 30 '12 16:01

xn dx


People also ask

How Stop JavaScript submit?

One way to stop form submission is to return false from your JavaScript function.

How do I stop form action in HTML?

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.

Can a submit button have a value?

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.

Can I use Submit button without form?

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 ....


1 Answers

If you remove the name attribute, it will not get passed through in GET/POST.

like image 55
Dan Breen Avatar answered Oct 14 '22 16:10

Dan Breen