Using a link for submitting a form via POST

I would like to know if there is a way to have a form which is submitted via POST, not GET to have a link which pretty much ascts like a submit button. I know I can do this with GET, but I don't like the fact that the entire URL is seen in the browser and I am also sending data which has many non-standard characters (spaces, quotes, etc.) which can't be sent in an href without having to convert all those symbols to the %## form. I know that this issue is not a problem with POST, but as far as I know, you always have to have a <FORM> tag with <INPUT> tags and a submit button somewhere, which I don't want to have.

I'll also accept a URL or a table of the conversions of those non-standard characters like " being %22 and ! being %21, etc.

Thank you!

Elam Birnbaum
elambAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

colforbinCommented:
You can use Javascript:

Your link would look like this
<FORM NAME=YourFormNameHere ACTION=whereever METHOD=POST>
<a href="javascript:submitForm()">
or
<a href=# onClick=submitForm()>
</FORM>

then your javascript would submit the form

<script language="JavaScript">
function submitForm () {
      document.YourFormNameHere.submit();
}
</script>

Something like that should work
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srividya_krisCommented:
if your major concern is to avoid the url from appearing on the location
U can create frames on the page. the top frame of a small width. and make the target of the form being submitted as the bottom frame.
thus the url in the location will always carry the address of the top frame and will not reveal the url of the page that is being displayed in the bottom frame.
0
colforbinCommented:
Similarly, you can do this with javascript

<a href="http://uglyURL.html" ONMOUSEOVER="status='Whatever you want to show up on browser'; return true;"  ONMOUSEOUT="status='';"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.