Form Action problem

Results 1 to 3 of 3

Thread: Form Action problem

  1. #1
    PCS Guest

    Default Form Action problem

    This is how it looks.<BR>Page A.asp contains an input box and a submit button.<BR>The values of input box have to be submitted to B.asp<BR><BR>And here I have another page C.asp which describes the frame structure as follows.<BR><BR>&#060;HTML&#062;<BR>&#060;HEAD&#06 2;<BR><BR>&#060;/HEAD&#062;<BR>&#060;FRAMESET COLS="20%,*" BORDER="0"&#062;<BR> &#060;FRAME SRC="menu.html" NAME="menu" MARGINWIDTH="0"<BR> MARGINHEIGHT="0" SCROLLING="No"&#062;<BR> &#060;FRAME SRC="B.asp" NAME="main" MARGINWIDTH="0"<BR> MARGINHEIGHT="5"&#062;<BR>&#060;/FRAMESET&#062;<BR><BR>&#060;NOFRAMES&#062;<BR>&#06 0;BODY&#062;<BR>&#060;P&#062;<BR>&#060;/BODY&#062;&#060;/NOFRAMES&#062;&#060;/HTML&#062;<BR><BR>Now the question is, what page to mention in Form action of A.asp? Is it B.asp or C.asp?? <BR>The result should be, it should redirect me to C.asp(so that I can see the frame structure), and the value to be submitted to B.asp??<BR><BR>Thanks for any help

  2. #2
    Join Date
    Dec 1969

    Default RE: Form Action problem

    you cannot submit the page (A.asp) to C.asp (which happens to be a frameset) and expect the b.asp to retrieve the a.asp information as the method of page invocation done by C.asp is "Get". Hence the form contents of A.asp will not be available in B.asp.<BR>the possible solutions i can think of now are<BR><BR>1. Post the A.asp to B.asp<BR> Validate and save<BR> redirect to C.asp<BR> In B.asp you should have two sections one for the "POst" (invoked by a.asp) and one for the Get Operation (invoked from frameset c.asp). You can do the validations in Post Section of B.asp, Query/retrieve and display the information from "Get" section of that asp page.<BR>For Example:<BR>B.asp<BR>If Request.ServerVariables("REQUEST_METHOD") = "Post" Then<BR> ---&#062; validate, Save to database<BR> Response.redirect "C.asp?keyVal=somekeyvalue"<BR>Elseif Request.ServerVariables("REQUEST_METHOD") = "Get" Then<BR> Query and Retrieve the information from database<BR> Dispaly the information<BR>End IF<BR><BR>2. Post the information from A.asp to C.asp.<BR> Move the validation code from B.asp to C.asp <BR> Only the query and display routines will be in B.asp, which will be executed when the frameset invokes b.asp through Get operation.<BR><BR><BR>3. you can else move the information through cookies or Query string as well.. which i feel is Security breach.<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Not as easy as you would want...

    ...but not that hard.<BR><BR>First of all, in your A.asp, you need &#060;FORM Action="C.asp"&#062;<BR><BR>But then the problem is that C.asp is the one that will get the contents of your INPUT box from A.asp! So now you need a way to get the info from C.asp into B.asp, right?<BR><BR>There are a couple of ways, but if there is only one text field involved, and if the user had to submit that field anyway, I&#039d do this:<BR><BR>****** FILE: C.asp *******<BR>&#060;FRAMESET COLS="20%,*" BORDER="0"&#062;<BR>&nbsp; &nbsp; &#060;FRAME SRC="menu.html" NAME="menu" MARGINWIDTH="0" <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MARGINHEIGHT="0" SCROLLING="No"&#062;<BR>&nbsp; &nbsp; &#060;FRAME SRC=&#039B.asp?info=&#060;% = Server.URLEncode(Request("TextFieldInfo") ) %&#062;&#039 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NAME="main" MARGINWIDTH="0" MARGINHEIGHT="5"&#062;<BR>&#060;/FRAMESET&#062;<BR>********************<BR><BR>The other way to do it is to store the info in a Session variable in page C.asp and then retrieve the info from the Session variable in B.asp.<BR><BR>

Posting Permissions

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