Submit via ASP Code

Discussion in 'ASP General' started by James Baker, Jun 11, 2004.

  1. James Baker

    James Baker Guest

    I have an intermediate page that takes a querystring, does a query on a
    database and writes out hidden values for each returned record. This design
    layout is necessary for a variety of reasons and not subject to change.

    I need the form to never be seen, essentially it needs to write out the
    hidden values and immediately post to another form when it's done. I have
    everything accomplished but the posting. Is there a technique to post the
    form via code as opposed to a submit button or something of that nature?

    Thanks,
    James
     
    James Baker, Jun 11, 2004
    #1
    1. Advertising

  2. James Baker

    Steven Burn Guest

    You'd be better off uing client side Javascript to do this, but I'm a little
    concerned about why your using a form you don't essentially need?.

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "James Baker" <> wrote in message
    news:O5b6Z##...
    > I have an intermediate page that takes a querystring, does a query on a
    > database and writes out hidden values for each returned record. This

    design
    > layout is necessary for a variety of reasons and not subject to change.
    >
    > I need the form to never be seen, essentially it needs to write out the
    > hidden values and immediately post to another form when it's done. I have
    > everything accomplished but the posting. Is there a technique to post the
    > form via code as opposed to a submit button or something of that nature?
    >
    > Thanks,
    > James
    >
    >
     
    Steven Burn, Jun 11, 2004
    #2
    1. Advertising

  3. I am not exaclty sure what you are trying to do here but...

    You can always write a little javascript code at the end of the file (or on
    onload) that would simply call the click event of the submit button like
    this:

    document.getElementById('submitBtn').click();

    I am confused why you have to go back to the client at all if you are not
    allowing them to do anything with the values.

    "James Baker" <> wrote in message
    news:O5b6Z%23%...
    > I have an intermediate page that takes a querystring, does a query on a
    > database and writes out hidden values for each returned record. This

    design
    > layout is necessary for a variety of reasons and not subject to change.
    >
    > I need the form to never be seen, essentially it needs to write out the
    > hidden values and immediately post to another form when it's done. I have
    > everything accomplished but the posting. Is there a technique to post the
    > form via code as opposed to a submit button or something of that nature?
    >
    > Thanks,
    > James
    >
    >
     
    Vance Kessler, Jun 11, 2004
    #3
  4. I'm with the others and would ask my favorite of all questions - What
    are you trying to accomplish? Just because one particular design was
    initially utilized, doesn't mean that it was the best possible design
    for the problem. If the design layout is neccessary as you say, please
    share the specifics with us as to why its neccessary.

    David H

    James Baker wrote:
    > I have an intermediate page that takes a querystring, does a query on a
    > database and writes out hidden values for each returned record. This design
    > layout is necessary for a variety of reasons and not subject to change.
    >
    > I need the form to never be seen, essentially it needs to write out the
    > hidden values and immediately post to another form when it's done. I have
    > everything accomplished but the posting. Is there a technique to post the
    > form via code as opposed to a submit button or something of that nature?
    >
    > Thanks,
    > James
    >
    >
     
    David C. Holley, Jun 11, 2004
    #4
  5. Vance Kessler wrote:
    > I am not exaclty sure what you are trying to do here but...
    >
    > You can always write a little javascript code at the end of the file
    > (or on onload) that would simply call the click event of the submit
    > button like this:
    >
    > document.getElementById('submitBtn').click();
    >

    Why bother with that? Just

    document.forms(0).submit();

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jun 11, 2004
    #5
  6. James Baker

    Slim Guest

    What every one including myself is concerned with is that you are trying to
    post info to the server that you already have on the server

    what ever is done with that info when it is submitted should be done on the
    the page you want to resubmit

    but anyway, ill show you want you need, but i think it is teh wrong way to
    go about it

    put this at the end of the page
    <SCRIPT LANGUAGE=javascript>
    document.forms(0).submit()
    </SCRIPT>


    "James Baker" <> wrote in message
    news:O5b6Z##...
    > I have an intermediate page that takes a querystring, does a query on a
    > database and writes out hidden values for each returned record. This

    design
    > layout is necessary for a variety of reasons and not subject to change.
    >
    > I need the form to never be seen, essentially it needs to write out the
    > hidden values and immediately post to another form when it's done. I have
    > everything accomplished but the posting. Is there a technique to post the
    > form via code as opposed to a submit button or something of that nature?
    >
    > Thanks,
    > James
    >
    >
     
    Slim, Jun 13, 2004
    #6
  7. James Baker

    David Holley Guest

    Actually, now that I think about it - If you're concerned abou t the
    amount of work neccessary to alter things so that a page isn't sent to
    the client, it shouldn't be that difficult. All it should take is
    putting the ASP for both pages on the same page and then altering the
    code to store/retrieve the values in variables or an array. You'll be
    using the variables for what they were intended for (to store
    information) which is what you're using the form fields for.


    David C. Holley
    www.gatewayorlando.com

    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    David Holley, Jun 13, 2004
    #7
    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. Mark
    Replies:
    1
    Views:
    1,721
  2. Ghafran Abbas
    Replies:
    0
    Views:
    4,241
    Ghafran Abbas
    Oct 12, 2004
  3. The Crow
    Replies:
    2
    Views:
    4,406
    Bruce Barker
    Sep 27, 2005
  4. Megha Vishwanath
    Replies:
    2
    Views:
    9,848
    tutorialsmaster
    Oct 2, 2009
  5. Replies:
    2
    Views:
    6,255
Loading...

Share This Page