Remove “_submit=Search” url parameter

Notice: This thread is very old.
tpr
Member | 55
+
0
-

When I set a form to have GET method, after submit the url also contains the submit button's label – which I would like to avoid, if possible.

site.com/search/?q=helloworld&_submit=Search

Is there's a way to disable it? I'm using Nette Forms as a standalone version (latest).

(as a last resort I can remove it using JavaScript)

Last edited by tpr (2016-01-30 17:52)

CZechBoY
Member | 3608
+
0
-

You can use route with default parameter _submit=search.

tpr
Member | 55
+
0
-

I'm afraid I can't do that because I use Forms as standalone in another system.

CZechBoY
Member | 3608
+
+1
-

No, there is no official way to remove this because then you dont know which button submitted the form.

tpr
Member | 55
+
0
-

Thanks, that makes sense. Unfortunately I need the GET method because it's a search form. I'll go the JS way, no biggie.

Šaman
Member | 2635
+
+1
-

You can work with search form same way as every other form – in onSuccess do redirect.

tpr
Member | 55
+
0
-

Thanks Šaman, it works fine now. Could have thought of it myself earlier :)