Can I POST from a link?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • German B. Garcia

    Can I POST from a link?

    I just want to set a link to a new page that needs some parameters
    but I don't want these to be seen in the location bar (and don't want
    to hide it). Is there any way to do it?

    (I try to generate a POST form on the fly and submit it. It works but
    this form is included in the history object an is accesed through the
    back button. [using form.submit() can't use Location.replac e() :-( ])

    ThankYou for any help.

    German.

  • Lasse Reichstein Nielsen

    #2
    Re: Can I POST from a link?

    "German B. Garcia" <german@we.lc.e hu.es> writes:
    [color=blue]
    > I just want to set a link to a new page that needs some parameters
    > but I don't want these to be seen in the location bar (and don't want
    > to hide it). Is there any way to do it?
    >
    > (I try to generate a POST form on the fly and submit it. It works but
    > this form is included in the history object an is accesed through the
    > back button. [using form.submit() can't use Location.replac e() :-( ])[/color]

    Why generate it on the fly?

    You can have the form already on the same page as the link, just hidden
    from view (make all inputs type="hidden" or something). Then you can fill
    in the fields, if they need to change, and have the link submit it.
    Just make sure that the link does something useful if Javascript is not
    available.


    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • SzokU

      #3
      Re: Can I POST from a link?

      You can do it with iframes.
      Place your form in iframe or create iframe named "example". Set atribute
      target="example " of your form and then submit it.
      Your page with parameters will be change inside iframe, but your primary
      page will stay.
      Of course You can hide iframes with styles. ;)

      Pozdro!
      SzokU, Poland


      Comment

      Working...