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 

iis url rewrite module:

<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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -