Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove trailing question mark with form method=get

Tags:

html

forms

button

I'm using a form button to send me to a page when I click it http://example.com/folder/upload/ but for some reason when I click the button it adds a trailing question mark at the end like this: http://example.com/folder/upload/?

My current code looks like this:

<form method="get" action="http://example.com/folder/upload/"><button type="submit" class="green button"><i  class="photo" ></i></button></form>

How can I get rid of the question mark without using method="post" because I want users to be able to refresh the page without having the Confirm Form Re-submission dialog popping up.

Is there another way of fixing this without using method="post"?

I'd prefer a solution without using onclick or any javascript if possible.

like image 991
user1797681 Avatar asked Nov 04 '12 22:11

user1797681


1 Answers

The question mark is part of the definition of form submission with the GET method, so no.

You can get rid of the question mark by using a link instead of artificial form submission that does not really submit anything. Links want to be links.

like image 129
Jukka K. Korpela Avatar answered Nov 17 '22 09:11

Jukka K. Korpela