Results 1 to 5 of 5

Thread: 4 forms how do i........do this

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    4 forms how do i........do this

    i want to on my 4th asp form take all my data collected from form1 and form 2 and form 3 and form 4 do one insert into my database of the values how do i call the values. i have hidden fields in my forth form how do i get them to reflect the Firstname value of my firstname text box in form 1

    i have tried using <%request.form("firstname")%> in the value of my hiiden field on the forth form..

    does this make sense
    or can anyone tell me an easier way of doing it.

    i have an application that i have designed that after my 4th page
    take all my values of the text boxes and do 1 insert with all that data into my database.....??? how do i do that at the moment im
    inserting values from my first form/page then next one updating then 3rd fomr updating again and this does not seem right if i can parse all my data from all four forms to my last page then do 1 insert??

    please help me out this is urgent

    thank you

  2. #2
    Addicted Member rikshawdriver's Avatar
    Join Date
    Apr 2001
    Posts
    160
    Its a long time since I have done something ASP. Still..

    After the submission of form1 store the value recieved from the form in a temporary table with an id for submitter (a sessionid or username or something like that). This temporary table would be updated based on the other form data and when the data from the last form is submitted the previous form data can be retrieved from the temporary table and insert into the actual table.

    Hope this helps

  3. #3
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186

    Cool

    An Idea:

    Page1 submit to page2, in page2 retrieve the values into hidden fields, then submit to page3, retrieve all fields into hidden fields, then submit to page4 and yo now have all the fields in one form, submit to the database.

    André

  4. #4
    Lively Member
    Join Date
    Jan 2001
    Posts
    118
    i have tried using <%request.form("firstname")%> in the value of my hiiden field on the forth form..

    Shouldn't it be <%=request.form("firstname")%> (the '=')

    Yip... it tried it .. it works the '=' is neccesary.

    Without the '=' it will not give you an error but just a blank value!

    To test it.

    Make some of your hidden fields, 'text' (visible) then you will see the values. (just a tip for debugging in the future)
    Last edited by Sundance Kid; May 3rd, 2001 at 07:12 AM.

  5. #5
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Here is another alternative...

    Code:
    <html>
    <head></head>
    <body>
    <form name='Page1' method='POST' action='Page2.asp'>
    <input type='text' name='foo'>
    <input type='sumbit'>
    </form>
    </body>
    </html>
    Code:
    <%
      Session("foo") = Request.Form("foo")
    %>
    <html>
    <head></head>
    <body>
    <form name='Page2' method='POST' action='Page3.asp'>
    <input type='text' name='bar'>
    <input type='submit'>
    </form>
    </body>
    </html>
    Code:
    <%
      'This is the last ASP after all four forms.
      'Each form has set the previous form's submissions into Session
      'All I have to do his grab the previous page from Request
    
      mySQL = Session("foo") & Request.Form("bar")
      Response.Write(mySQLResult)
    %>
    I hope that makes sense. I think the session object has a 20 minute timeout. I don't know how it interacts with SSL. It is a step below actually setting cookies on the client's browser.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

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



Click Here to Expand Forum to Full Width