Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2005, 05:29 PM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Values missing from Response.Form

I'm on IIS 6.0 and having an issue that seems random.

Every once in a while I can click on the button to submit the form and when the server goes to process the data in Response.Form it is missing. Time doesn't seem to be an issue because I've had it occur when submitted under 5 minutes. Our Session.Timeout is set to 20 minutes.

If anyone could give me any ideas, it would be appreciated.

TIA,

Mike

Heres the code....

<% @Language=VBScript %>
<%
    Response.Expires = 0
    Response.Buffer = True
    Response.Clear
%>

<html>
<head>
    <title>TEST REQUEST.FORM</title>
    <meta NAME="DESCRIPTION" CONTENT="TEST REQUEST.FORM">
    <meta NAME="AUTHOR" CONTENT="Mike Kolenda">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<%
    Response.Write "<br>Entire Form: " 'REMOVE ME
    Response.Write Cstr( Request.Form )

    Response.Write "<br>Session.Timeout: " + Cstr( Session.Timeout ) 'Ours is set globally to 20


    Dim SCRIPT_NAME ' Script name so we can make it location independent
    SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")

    If Request.Form( "username" ) <> "" Then
        Response.Write "<br>DATA EXISTS IN FORM." 'REMOVE ME
        Response.Write "<br>username: " 'REMOVE ME
        Response.Write Cstr( Request.Form( "hiddenuser" ) )
    Else
        Response.Write "<br>THERE WAS NO DATA IN THE FORM!!!" 'REMOVE ME
        Response.Write "<br>username: " 'REMOVE ME
        Response.Write Cstr( Request.Form( "username" ) )
    End If

%>
<body>
    <form METHOD="post" ACTION="<%=SCRIPT_NAME%>" id="testform" name="testform">
    <center>
    <table border="1" bgcolor="AZURE" cellpadding="1" cellspacing="1" width="75%">
    <tr>
        <td colspan="2" valign="MIDDLE" align="LEFT" >
            User:
        </td>
        <td colspan="2" valign="MIDDLE" align="LEFT" >
            <input type="text" id="username" name="username" size="50">
        </td>
    </tr>
    <tr>
        <td Align="Left" colspan="2" >
        <input type="submit" value="Direct" id="trythis" name="trythis">
        </td>
        <td Align="Right" colspan="2" >
            <input type="button" value="Validate" onclick="javascript:ValidateForm()" id="nextitem" name="nextitem">
        </td>
    </tr>
    </table>
    </form>
    </center>

</body>
</html>

<script language="JavaScript">
<!--

history.forward();

function ValidateForm()
{
    //alert( "it was submitted for " + testform.username.value );
    formlen = testform.length;
    for (k=0; k<formlen; k++)
    {
        alert( testform.elements[k].name + ": " + testform.elements[k].value );
    }
    testform.submit();
}
-->
</script>
 
Old February 9th, 2005, 06:32 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This form posts values sometimes but every now and then it doesnt? - very strange. When this happens do no values get posted from any form element - or just some (if so which ones)?

This is not a soltion however I would place the client side validation in the head of your document.

Wind is your friend
Matt
 
Old February 10th, 2005, 08:59 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All values from the form are missing. This can be seen from "Response.Write Cstr( Request.Form )".

Also, please disregard the element "hiddenuser" it should be "username" as well. I reduced the size of the form to just the one input and the two buttons. I must have forgot to replace this.

It is very strange I'm not sure if there is a problem with code, server, or global.asa. I figured if anybody could give me any ideas I could get them here.

Thanks,

Mike
 
Old February 10th, 2005, 11:12 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is anybody using Application Pooling on their IIS Server? If so what settings are you using?



 
Old February 10th, 2005, 09:42 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default


Response.Write Cstr( Request.Form )
Will not return a result, you need to:
Response.Write Cstr(Request.Form("someElementName")

Does that work?



Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.write if statements in a form? natalie_2008 VBScript 7 April 30th, 2008 02:46 PM
response.write strSQL shows no values! ronny Classic ASP Databases 3 December 13th, 2007 01:50 PM
HTML table with missing values (elements) go4java XSLT 6 July 10th, 2006 03:31 AM
Text file import to data grid missing some values kf9thdon@aol.com ASP.NET 1.0 and 1.1 Basics 2 April 14th, 2006 10:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.