Request.Form returns nothing

Discussion in 'ASP General' started by Steve Last, Jul 6, 2006.

  1. Steve Last

    Steve Last Guest

    Hi all,

    I’m using IIS6 for our college Intranet and I’m having trouble using
    Request.Form. Here is my code:

    <%
    If Request.QueryString("action") = "show" Then
    Response.Write "title: " & Request.Form("NewsTitle") & "<br />"
    End If
    %>
    <form action="/_admin/blogs/test.asp?action=show" method="post">
    <input type="text" name="NewsTitle" />
    <input type="submit" value="Add" />
    </form>

    The page refreshes and generates the following HTML:

    title: <br />

    <form action="/_admin/blogs/test.asp?action=show" method="post">
    <input type="text" name="NewsTitle" />
    <input type="submit" value="Add" />
    </form>

    The Request.Form(“NewsTitleâ€) is empty. I’m sure my HTML and ASP/VBScript
    is ok, I’ve been writing for ages, but I’ve never seen it do this before.
    Request.QueryString works fine.

    After some Google searches some have hinted at Integrated Windows
    Authentication being involved. The page in question doesn’t have any
    authentication.

    Any ideas?

    Thanks in advance – and if this is the wrong newsgroup could you point me in
    the right direction.

    Steve
     
    Steve Last, Jul 6, 2006
    #1
    1. Advertisements

  2. Steve Last

    Mike Brind Guest

    Try doing this to see if you get anything:

    For Each x in Request.Form
    Response.Write x & ": " & Request.Form(x)
    Next
     
    Mike Brind, Jul 6, 2006
    #2
    1. Advertisements

  3. Steve Last

    Steve Last Guest



    Thanks for the reply. I've tried this - it returns absolutely nothing, here
    is the HTML after form submission:


    <form action="/_admin/blogs/test.asp?action=show" method="post">
    <input type="text" name="NewsTitle" />
    <input type="submit" value="Add" />
    </form>

    It's very strange. After more testing it seems to work (every time) when
    using Firefox, but not IE6 or IE7 (Beta3).

    I’m completely confused now!

    Any more ideas?

    Cheers, Steve
     
    Steve Last, Jul 6, 2006
    #3
  4. Steve Last

    Larry Bud Guest

    Your code works.... Maybe a buffering problem?
     
    Larry Bud, Jul 6, 2006
    #4
  5. Steve Last

    Slim Guest

    try a different name besides action maybe?

    have you tested that action does = "show"?
     
    Slim, Jul 6, 2006
    #5
  6. Steve Last

    Steve Last Guest



    Slim - thanks, but i'm 100% sure action=show is working.

    Larry - I've never looked at any buffering issues before, any pointers you
    can give? Settings somewhere in IIS maybe?

    Thanks both...

    Steve
     
    Steve Last, Jul 6, 2006
    #6
  7. Steve Last

    tctekkie Guest

    Use Request.FORM instead of Request.QUERYSTRING.

    Your form method is set to POST.

    Use Request.Form if using POST
    Use Request.QueryString if using GET
     
    tctekkie, Jul 6, 2006
    #7
  8. Steve Last

    tctekkie Guest

    OOPS!! My Overlook... Disregard my last post please!! (I think I've
    been working too long today). I didn't see the parameter being passed
    in the querystring... SORRY! :)
     
    tctekkie, Jul 6, 2006
    #8
  9. Steve Last

    Mike Brind Guest

    The only time I have ever seen anything like this is when I tried to
    submit a form from an html email in Outlook with Firefox set as a
    default browser. It never worked. When I made IE the default browser,
    it worked every time. I never got to the bottom of it. Don't even
    know if it's related to your troubles....
     
    Mike Brind, Jul 6, 2006
    #9
  10. Steve Last

    Steve Last Guest

    That's it - thanks Mike... :)

    I set IE6 to be the default browser, restart it and all was fine - same with
    IE7.

    I hope this post thread is searchable from Google so others who have this
    problem can find this answer. I searched for hours and found nothing!

    Thanks again,

    Steve
     
    Steve Last, Jul 10, 2006
    #10
  11. Steve Last

    Larry Bud Guest

    Slim - thanks, but i'm 100% sure action=show is working.
    Try response.buffer=false at the top of your page.

    There is a default setting in IIS for buffer... I would also try
    putting some no-cache code in the page for debugging purposes to make
    sure the page is actually reloading.

    It's got to be some sort of setting like this. I copied your code
    verbatim and it works fine on my server (iis5).
     
    Larry Bud, Jul 10, 2006
    #11
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.