html - Input with joined query component without JavaScript -
i have form
element , url be
http://example.com/page.html?a=constant+query_text
if wanted
http://example.com/page.html?a=constant&b=query_text
i use
<form action="http://example.com/page.html"> <input type="hidden" name="a" value="constant"> <input type="text" name="b"> <input type="submit"> </form>
but there way desired form without scripting?
you create server proxy you. put handler on server redirects requests target server , adds constant querystring. depending on web server, seems should able configuration settings, no code required.
<form action="/myproxy"> <input type="text" name="a"> <input type="submit"> </form>
apache mod_alias redirectmatch directive:
redirectmatch ^/myproxy?a=(.+)$ http://example.com/page.html?a=constant+$1
<rewrite> <rules> <rule name="proxyredirect" stopprocessing="true"> <match url="^myproxy?a=(.+)$"/> <action type="redirect" url="http://example.com/page.html?a=constant+{r:1}"/> </rule> </rules> </rewrite>
there no way html , no javascript.
Comments
Post a Comment