• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

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
0
elamb
Asked:
elamb
  • 2
1 Solution
 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now