FORMS in ASP

Results 1 to 6 of 6

Thread: FORMS in ASP

  1. #1
    Join Date
    Dec 1969
    Posts
    73

    Default FORMS in ASP

    I have form which user us to enter data in database but there is problem: <BR><BR>when user enters the value in the form, i take them to next page to verify the enteries and use ( Response.write Request.Form("variable") ) to do that, now if they are satisfied with enteries, they click on SUBMIt which take them to next page to send data to database. But problem is Response.write Request.Form("variable") field is empty in submit page.<BR><BR>How will i make sure value go from first page to last submit page ?<BR><BR>farhan

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: FORMS in ASP

    There are two ways to do this<BR><BR>I am assuming that you have created a form on the page<BR>where u r verifying, and you have a submit button.<BR>Lets say ur last page is LastPage.asp then<BR>in the action property of the form u can say<BR><BR>&#060;form action= LastPage.asp?&#060;%=Request.Form&#037;&#062; ><BR><BR>So a new querystring is formed which will go on to the <BR>next page.<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    73

    Default RE: FORMS in ASP

    This is what i have in Verify Page which is not working because value for Request.Form("employee") is empty:<BR><BR>&#060;% <BR>Dim con <BR>Dim rsList<BR>Dim MySQL <BR>On Error Resume Next <BR><BR>Set con = Server.CreateObject("ADODB.Connection")<BR>con.Ope n "pe" &#039system data sn<BR><BR>set rsList=server.CreateObject("ADODB.Recordset")<BR>< BR>MySQL="Select * from access Where employee=&#039" & Request.Form("employee") & "&#039 And evaluator=&#039" & Request.Form("employee") & "&#039 And password=&#039" & Request.Form("pass") & "&#039 "<BR> <BR>rsList.Open MySq , Con<BR>rsList.MoveFirst <BR><BR>&#037;&#062;<BR><BR>&#060;body link="#FF0000" vlink="#808080"><BR>&#060;% <BR><BR>if rslist.eof then <BR> Response.Redirect "error.asp"<BR>ELSE<BR> Response.Redirect "query_pass.asp"<BR>end if<BR>&#039rsList.MoveNext <BR>&#037;&#062;<BR>&#060;%rsList.Close <BR>set rsList=nothing <BR>set con=nothing &#037;&#062;<BR>&#060;/body><BR>&#060;/html><BR><BR>and this what if pasword is verfied: <BR><BR>&#060;%@ Language=VBScript &#037;&#062;<BR>&#060;% <BR>Dim con <BR>Dim rsList<BR>Dim MySQL <BR>Dim table1<BR>On Error Resume Next <BR><BR>Set con = Server.CreateObject("ADODB.Connection")<BR>con.Ope n "pe" &#039system data sn<BR><BR>set rsList=server.CreateObject("ADODB.Recordset")<BR>R esponse.write Request.Form("password") <BR>MySQL="Select * from access Where evaluator=&#039" & Request.Form("employee") & "&#039 "<BR> <BR>rsList.Open MySql , Con<BR>rsList.MoveFirst <BR><BR>&#037;&#062;<BR>&#060;html><BR><BR>&#060;h ead><BR>&#060;title>&#060;/title><BR>&#060;/head><BR><BR>&#060;body link="#FF0000" vlink="#808080"><BR>&#060;div align="center">&#060;center><BR><BR>&#060;table CELLSPACING="0" BORDER="0" WIDTH="608"><BR> &#060;tr><BR> &#060;b>&#060;td WIDTH="131" VALIGN="TOP">&#060;img src="../../images/BOSCH.GIF"<BR> alt="BOSCH.GIF (1166 bytes)" WIDTH="80" HEIGHT="23">&#060;/b>&#060;/td><BR> &#060;td WIDTH="8" VALIGN="MIDDLE">&nbsp;<BR><BR> &#060;/td><BR> &#060;td WIDTH="26" VALIGN="TOP">&#060;p ALIGN="CENTER">&#060;img src="../../images/ANKER.GIF"<BR> alt="ANKER.GIF (1247 bytes)" WIDTH="24" HEIGHT="24">&#060;/td><BR> &#060;td WIDTH="67" VALIGN="MIDDLE">&nbsp;<BR><BR> &#060;/td><BR> &#060;td WIDTH="378" VALIGN="TOP">&#060;div align="center">&#060;center>&#060;table border="0" cellpadding="0"<BR> cellspacing="0" width="100%" bgcolor="#808080"><BR> &#060;tr><BR> &#060;td width="100%">&#060;strong>&#060;font color="#FFFFFF" face="Verdana">Diesel Technology Company&#060;/font>&#060;/strong>&#060;/td><BR> &#060;/tr><BR> &#060;/table><BR> &#060;/center>&#060;/div>&#060;p>&#060;img SRC="../../images/10.gif" WIDTH="1" HEIGHT="3"><BR><BR> &#060;a href="http://www.bv.us.bosch.com">&#060;img SRC="../../images/Pfeil.gif" WIDTH="10"<BR> HEIGHT="10">&#060;/a>&#060;img SRC="../../images/boschgru.gif" ALT="The Bosch Group" width="100"<BR> height="11">&nbsp; &#060;font FACE="Arial,Geneva,Helvetica" SIZE="-1">&#060;a<BR> href="../../default.htm">&#060;img SRC="../../images/pfeilba.gif" BORDER="2" WIDTH="10"<BR> HEIGHT="10">&#060;/a> &#060;/font>&#060;font FACE="Arial,Geneva,Helvetica" size="3">&#060;strong>back&#060;/strong>&#060;/font>&#060;/td><BR> &#060;/tr><BR> &#060;tr><BR> &#060;td WIDTH="91" VALIGN="TOP">&#060;/td><BR> &#060;td WIDTH="9" VALIGN="MIDDLE">&#060;/td><BR> &#060;td WIDTH="27" VALIGN="TOP">&#060;/td><BR> &#060;td WIDTH="67" VALIGN="MIDDLE">&#060;/td><BR> &#060;td WIDTH="404" VALIGN="TOP">&#060;/td><BR> &#060;/tr><BR>&#060;/table><BR>&#060;/center>&#060;/div>&#060;div align="center">&#060;center><BR><BR>&#060;table width="546"><BR> &#060;tr><BR> &#060;td width="292" bgcolor="#808080" align="center">&#060;font face="Arial" color="#FFFFFF">&#060;b>Emplooyee<BR> You evaluating &#060;/b>&#060;/font>&#060;/td><BR> &#060;td width="191" bgcolor="#808080" align="center">&#060;font face="Arial" color="#FFFFFF">&#060;strong>Password&#060;/strong>&#060;/font>&#060;/td><BR> &#060;td width="229" bgcolor="#808080" align="center">&#060;font face="Arial" color="#FFFFFF">&#060;strong>Evaluating<BR> As&#060;/strong>&#060;/font>&#060;/td><BR> &#060;/tr><BR>&#060;% do while not rslist.eof<BR> Response.write employee <BR>&#037;&#062;<BR> &#060;tr><BR> &#060;td width="292" align="center">&#060;font face="Arial">&#060;%=rslist("evaluator")&#037;&#06 2;&#060;/font> &#060;/td><BR> &#060;td width="191" align="center">&#060;font face="Arial">&#060;%=rslist("password")&#037;&#062 ;&#060;/font> &#060;/td><BR> &#060;td width="229" align="center">&#060;font face="Arial">&#060;%=rslist("eval_as")&#037;&#062; &#060;/font> &#060;/td><BR> &#060;/tr><BR>&#060;%rsList.MoveNext <BR>loop<BR>&#037;&#062;<BR>&#060;/table><BR>&#060;/center>&#060;/div>&#060;%rsList.Close <BR>set rsList=nothing <BR>set con=nothing &#037;&#062;<BR><BR>&#060;/body><BR>&#060;/html><BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    119

    Default RE: FORMS in ASP

    Well this is what i understand<BR><BR>Page 1 : User enters the data<BR>Page 2 : You show the entered data. (User is satisfied presses<BR> submit)<BR>Page 3 : You actually enter data into database<BR><BR>Now If you are not getting values from page 1 onto page 2<BR>these may be the problems<BR><BR>Your Method may be GET on Page 1(so u will have to use Request.QueryString("")<BR><BR>Or there are more than one field on the first page which have<BR>got the same name "employee"<BR><BR><BR>(Any ways why dont u try using Request("Employee")<BR>instead of Re..Form("employee") or Re..QueryString("Employee")<BR><BR>Manish<BR><BR>M anish<BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    109

    Default RE: FORMS in ASP

    Put the data in hidden input tags on the verify page. That way when you go to the 3rd asp, the data will still be in the form collection.<BR><BR>e.g. for every variable do something like this:<BR><BR>Response.write Request.Form("variable")<BR>Response.write "&#060;input type=&#039hidden&#039 name = &#039" & variable & "&#039 value=&#039" & Request.Form("variable") & "&#039><BR><BR>Although it would be better to store Request.Form("variable") in its own variable to cut down on the calls to the com object.<BR><BR><BR>Oliver

  6. #6
    Join Date
    Dec 1969
    Posts
    73

    Default RE: FORMS in ASP

    Thanks so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •