Forced submit

Discussion in 'ASP General' started by Ellie, Sep 5, 2008.

  1. Ellie

    Ellie Guest

    How can I force a submit on a form. I want to load a form but then I want to
    close it and have it do something and then redirect it. This is ASP 3.0.
    thanks
     
    Ellie, Sep 5, 2008
    #1
    1. Advertising

  2. Ellie

    Old Pedant Guest

    "Ellie" wrote:

    > How can I force a submit on a form. I want to load a form but then I want to
    > close it and have it do something and then redirect it. This is ASP 3.0.


    <body onLoad="document.forms[0].submit( );">

    Assuming it is first form on the page.
     
    Old Pedant, Sep 5, 2008
    #2
    1. Advertising

  3. Ellie

    Evertjan. Guest

    =?Utf-8?B?T2xkIFBlZGFudA==?= wrote on 05 sep 2008 in
    microsoft.public.inetserver.asp.general:

    > "Ellie" wrote:
    >
    >> How can I force a submit on a form. I want to load a form but then I
    >> want to close it and have it do something and then redirect it. This
    >> is ASP 3.0.

    >
    > <body onLoad="document.forms[0].submit( );">
    >
    > Assuming it is first form on the page.
    >


    Indeed, the whole concept of form and submitting is clientsiide, not ASP.

    You cannot close a form.

    You cannot redirect a form.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Sep 5, 2008
    #3
  4. Ellie wrote:
    > How can I force a submit on a form. I want to load a form but then I
    > want to close it and have it do something and then redirect it. This
    > is ASP 3.0. thanks


    I don't understand ... why load the form in the first place? Just
    process the data and redirect to the page you really want to go ... ?

    --
    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], Sep 5, 2008
    #4
  5. Ellie

    Ellie Guest

    Probably because I don't know what I'm doing! I have to upload a file but it
    doesn't work if I try to put it in the same asp page as all of the other
    processing. I have to add the ENCTYPE="multipart/form-data" to the form
    statement which my page doesn't seem to like. I didn't know I could have
    more than one form on a page??? This does open up a lot more possibilitie
    but it seems I can get that accomplished with having a redirect to a form
    input page, pass it the file information to upload, submit the form and then
    redirect it back to what the original page was doing.

    "Bob Barrows [MVP]" <> wrote in message
    news:%...
    > Ellie wrote:
    >> How can I force a submit on a form. I want to load a form but then I
    >> want to close it and have it do something and then redirect it. This
    >> is ASP 3.0. thanks

    >
    > I don't understand ... why load the form in the first place? Just
    > process the data and redirect to the page you really want to go ... ?
    >
    > --
    > 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.
    >
    >
     
    Ellie, Sep 5, 2008
    #5
  6. Ellie

    Evertjan. Guest

    Ellie wrote on 05 sep 2008 in microsoft.public.inetserver.asp.general:

    > I can get that accomplished with having a redirect to a form
    > input page, pass it the file information to upload, submit the form
    > and then redirect it back to what the original page was doing.
    >


    You cannot do anything clientside, like submit a form,
    and after that do a serverside redirect.

    And a clientside redirect, what is that?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Sep 5, 2008
    #6
  7. "Ellie" <> wrote in message
    news:...
    > Probably because I don't know what I'm doing! I have to upload a file but
    > it doesn't work if I try to put it in the same asp page as all of the
    > other processing. I have to add the ENCTYPE="multipart/form-data" to the
    > form statement which my page doesn't seem to like. I didn't know I could
    > have more than one form on a page??? This does open up a lot more
    > possibilitie but it seems I can get that accomplished with having a
    > redirect to a form input page, pass it the file information to upload,
    > submit the form and then redirect it back to what the original page was
    > doing.
    >


    What are you using on the serverside to receive the file?

    When using multipart/form-data encoding ASPs Request.Form collection is not
    able to return the field contents. The fields are there but encoded as mime
    parts which ASP doesn't understand. Some serverside uploader tools allow
    you to access these fields. Without this sort of support it will be
    difficult to achieve what you want in a pure HTML form.

    Note that a file input cannot be initialised with a file path. Hence any
    plan to have the response form an ordinary post to automatically send
    another post containing the file will fail.


    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Sep 6, 2008
    #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. Bill Wilson

    Forced user logins

    Bill Wilson, Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    369
    Bill Wilson
    Jul 19, 2003
  2. H Branyan

    Javascript forced button click

    H Branyan, Oct 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    445
    H Branyan
    Oct 29, 2003
  3. Paul Johnson

    Forced Image Refresh

    Paul Johnson, Jan 10, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    624
    Paul Johnson
    Jan 10, 2004
  4. =?Utf-8?B?VkIgVGVzdGVy?=

    Server Forced PostBack

    =?Utf-8?B?VkIgVGVzdGVy?=, Feb 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    433
    Scott M.
    Feb 9, 2004
  5. =?Utf-8?B?ZmJ3aGl0ZUBvbmxpbmUubm9zcGFt?=

    Users are randomly losing session and are forced to relogin

    =?Utf-8?B?ZmJ3aGl0ZUBvbmxpbmUubm9zcGFt?=, Nov 10, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    580
    =?Utf-8?B?U2hyaW5pdmFz?=
    Dec 3, 2004
Loading...

Share This Page