Quantcast
Channel: When submitting a GET form, the query string is removed from the action URL - Stack Overflow
Browsing latest articles
Browse All 15 View Live

Answer by jason. for When submitting a GET form, the query string is removed...

Here's some simple JavaScript to keep your existing query strings when you submit your GET form. It uses the URL API which supported everywhere except IE.const form =...

View Article



Answer by user2298124 for When submitting a GET form, the query string is...

My observationwhen method is GET and form is submitted, hidden input element was sent as query parmater. Old params in action url were wiped out. So basically in this case, form data is replacing query...

View Article

Answer by MRE20 for When submitting a GET form, the query string is removed...

To answer your first question yes the browser does that and the reason isthat the browser does not care about existing parameters in the action URLso it removes them completelyand to prevent this from...

View Article

Answer by Daniel-KM for When submitting a GET form, the query string is...

When the original query has array, for php:foreach (explode("\n", http_build_query($query, '', "\n")) as $keyValue) { [$key, $value] = explode('=', $keyValue, 2); $key =...

View Article

Answer by TH_ for When submitting a GET form, the query string is removed...

This is in response to the above post by Efx:If the URL already contains the var you want to change, then it is added yet again as a hidden field.Here is a modification of that code as to prevent...

View Article


Answer by Rápli András for When submitting a GET form, the query string is...

I usually write something like this:foreach($_GET as $key=>$content){ echo "<input type='hidden' name='$key' value='$content'/>";}This is working, but don't forget to sanitize your inputs...

View Article

Answer by Shashidhar Gr for When submitting a GET form, the query string is...

<form ... action="http:/www.blabla.com?a=1&b=2" method ="POST"><input type="hidden" name="c" value="3" /> </form>change the request method to' POST' instead of 'GET'.

View Article

Answer by wanis for When submitting a GET form, the query string is removed...

If you need workaround, as this form can be placed in 3rd party systems, you can use Apache mod_rewrite like this:RewriteRule ^dummy.link$ index.php?a=1&b=2 [QSA,L]then your new form will look like...

View Article


Answer by xyphoid for When submitting a GET form, the query string is removed...

In HTML5, this is per-spec behaviour.See Association of controls and forms - Form submission algorithm.Look at "4.10.22.3 Form submission algorithm", step 17. In the case of a GET form to an http/s URI...

View Article


Answer by Efx for When submitting a GET form, the query string is removed...

What you can do is using a simple foreach on the table containing the GET information. For example in PHP :foreach ($_GET as $key => $value) { $key = htmlspecialchars($key); $value =...

View Article

Answer by Jay for When submitting a GET form, the query string is removed...

Your construction is illegal. You cannot include parameters in the action value of a form. What happens if you try this is going to depend on quirks of the browser. I wouldn't be surprised if it worked...

View Article

Answer by KillerRabbit for When submitting a GET form, the query string is...

I had a very similar problem where for the form action, I had something like:<form action="http://www.example.com/?q=content/something" method="GET"><input type="submit" value="Go away..."...

View Article

Answer by Bernhard Hofmann for When submitting a GET form, the query string...

You should include the two items (a and b) as hidden input elements as well as C.

View Article


Answer by Arjan for When submitting a GET form, the query string is removed...

Isn't that what hidden parameters are for to start with...?<form action="http://www.example.com" method="GET"><input type="hidden" name="a" value="1" /> <input type="hidden" name="b"...

View Article

When submitting a GET form, the query string is removed from the action URL

Consider this form:<form action="http://www.blabla.com?a=1&b=2" method="GET"><input type="hidden" name="c" value="3" /> </form>When submitting this GET form, the parameters a and...

View Article

Browsing latest articles
Browse All 15 View Live




Latest Images