Q:

Input with joined query component without JavaScript

I have a form element and I would like the URL to be

http://example.com/page.html?a=constant+QUERY_TEXT

If I wanted

http://example.com/page.html?a=constant&b=QUERY_TEXT

I could 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 is there any way to get my desired form without scripting?

A:

You could create a server proxy to do it for you.  Put a handler on your server that redirects requests to the target server and adds the constant to the querystring.  Depending on your web server, it seems like you should be able to do this with just 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 is no way to do it with just HTML and no JavaScript.

