Many of the web pages I am working on use files such as images and scripts that are mostly on a different domain from the page itself, so I put a base tag in the head of the page. For most purposes, this makes the site easier to work on. However, the page has a form, and I want to make the form submit to the same domain as the page. I would like to use a relative URL for the form action, so if we ever feel the need to move the page to a different domain, we would be able to do so easily.
The problem I am running into is that the browser (any browser I test the page in) is applying the relative URL to the base href, rather than the page domain. For example, if I have a site on the domain foo.com, and I have the base href set to bar.com, and the form action is "/submit", the form will submit to "bar.com/submit", when I am trying to make it submit to "foo.com/submit".
Does anyone know a way to make the browser ignore the base href attribute just for form submits? I have figured out ways to do it involving Javascript, which I can post if anyone cares to see them, but I am wondering whether there is a simpler way, without involving Javascript.