Submitting a form

Discussion in 'ASP General' started by Griff, Jun 27, 2005.

  1. Griff

    Griff Guest

    I've inherited an ASP application that currently builds up a URL with a
    series of keys and values (http://url?key=value&key=value&key=value).

    Having built this up programmatically, it then does a Response.Redirect
    command.

    The problem I have is that I need to add a new key and value to this, but
    the existing URL is so long that it almost breaks the limit for the length
    of a URL. So, as soon as I add on my new key-value it breaks.

    I wondered about shortening the names, but on inspection it appears that my
    predecessor has already gone down that path.

    What I therefore want to do is to create a form with hidden text fields and
    make the form POST the data.

    Within the ASP code, it's fairly trivial to build up this form in the same
    way that the URL was built up.

    However, I now need to SUBMIT this form from my ASP page (running on IIS).

    What would be the equivalent of the Response.Redirect command that will now
    submit my form?

    Or...is there an even better way to go about this....?

    Griff
    Griff, Jun 27, 2005
    #1
    1. Advertising

  2. Griff wrote:
    > I've inherited an ASP application that currently builds up a URL with
    > a series of keys and values
    > (http://url?key=value&key=value&key=value).
    >
    > Having built this up programmatically, it then does a
    > Response.Redirect command.
    >
    > The problem I have is that I need to add a new key and value to this,
    > but the existing URL is so long that it almost breaks the limit for
    > the length of a URL. So, as soon as I add on my new key-value it
    > breaks.
    >
    > I wondered about shortening the names, but on inspection it appears
    > that my predecessor has already gone down that path.
    >
    > What I therefore want to do is to create a form with hidden text
    > fields and make the form POST the data.
    >
    > Within the ASP code, it's fairly trivial to build up this form in the
    > same way that the URL was built up.
    >
    > However, I now need to SUBMIT this form from my ASP page (running on
    > IIS).
    >
    > What would be the equivalent of the Response.Redirect command that
    > will now submit my form?
    >
    > Or...is there an even better way to go about this....?
    >
    > Griff



    A couple options (there are more):

    1. Use client-side code to submit the form in the onload event - follow up
    in a client-side scripting newsgroup such as .scripting.jscript for
    assistance with this approach
    2. Use ServerXMLHTTP to submit your data to the other page and retrieve the
    results. - http://www.aspfaq.com/show.asp?id=2173

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Jun 27, 2005
    #2
    1. Advertising

  3. Griff

    Griff Guest

    Bob

    The JavaScript option seems most suitable in this instance as it doesn't
    come back.

    So, I'll use the onLoad() event in the body to call some javascript to
    submit the form.

    Thanks!

    Griff
    Griff, Jun 27, 2005
    #3
  4. Griff

    Adrienne Guest

    Gazing into my crystal ball I observed "Griff" <> writing
    in news::

    > Bob
    >
    > The JavaScript option seems most suitable in this instance as it doesn't
    > come back.
    >
    > So, I'll use the onLoad() event in the body to call some javascript to
    > submit the form.
    >
    > Thanks!
    >
    > Griff
    >
    >
    >


    Be aware that you are going to have to provide a non-javascript alternative
    for users who do not have javascript enabled.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jun 28, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Brown

    Submitting form with a unique ID

    James Brown, Jul 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    366
    David Waz...
    Jul 6, 2003
  2. Mike Szanto
    Replies:
    1
    Views:
    505
  3. Dave Smithz
    Replies:
    3
    Views:
    34,553
    mokker
    Oct 30, 2009
  4. Marco Alting
    Replies:
    7
    Views:
    493
    Thomas 'PointedEars' Lahn
    Oct 30, 2003
  5. Kai Grossjohann
    Replies:
    4
    Views:
    260
Loading...

Share This Page