[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Classic ASP - How to continue transferring hidden form fields from one page to the next.

Posted on 2006-05-18
14
Medium Priority
?
273 Views
Last Modified: 2012-06-27
Hello.  I am using Classic ASP VBScript.  I have 3 pages with which I'm working.  2 pages consist of a 2-part form.  The third page is a final review.

**View: http://www.charactercorner.com/newcc/test_form.asp

1) Page 1 = Section 1 of form
2) Page 2 = Section 2 of form (review section for Section 1)
3) Page 3 = Final review for both Section 1 and Section 2.


The problem:

Information from Section 1 (Page 1) is not being passed to the Final Review (Page 3).  It will pass to Section 2 (Page 2) and display just fine.  I add the Section 1 "hidden fields" to the Section 2 form, but only the Section 2 form fields transfer to the Final Review (Page 3).  It's like it will only hold it for one page, then lose it.  I list my "dim" information in the top of the pages, along with the "request.form..." requests.  The link above only consists of a short, basic form, but the same principle applies.

How can I get the form field data to pass to all pages?

Thanks so much,
Shane
0
Comment
Question by:lshane
  • 5
  • 5
  • 4
14 Comments
 
LVL 22

Expert Comment

by:WMIF
ID: 16712316
please share with us the code where you are adding section 1's data to section 2's page.  
0
 
LVL 6

Accepted Solution

by:
BubbaisBest earned 1000 total points
ID: 16712328
Shane,

Are you setting the value for your hidden fields?

<input type="hidden" name="field1" value="<%=Request.Form("Field1Page1")%>" />

Then on page 3 you should be able to call Request.Form("field1")

Bubs
0
 

Author Comment

by:lshane
ID: 16712523
Hello, WMIF.  Here's the code for pages 1, 2, and 3 (just simple tables).  Page 3 is not showing the data from Page 1, however, Page 2 shows the data from Page 1 just fine.  Yes, BubbaisBest, I did assign the values for the hiden fields.

------------------------------------------------------------------------------------------------------------------------------------
PAGE 1:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body>

<table width="537" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="537"><form name="form1" method="post" action="test_form_receive.asp">
    <table width="600" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="88">Name:</td>
        <td width="449"><input name="formname" type="text" id="formname"></td>
      </tr>
      <tr>
        <td>E-mail:</td>
        <td><input name="formemail" type="text" id="formemail"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="Submit" value="Submit"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </form></td>
  </tr>
</table>
</body>
</html>
------------------------------------------------------------------------------------------------------------------------------------
PAGE 2:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<%
Dim formname, formemail
formname=request.form("formname")
formemail=request.form("formemail")
%>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body>

<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="74">Name:</td>
    <td width="526"><%=formname%></td>
  </tr>
  <tr>
    <td>E-mail:</td>
    <td><%=formemail%></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><form name="form1" method="post" action="test_form_receive.asp">
    <table width="600" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="96">Address:</td>
        <td width="504"><input name="formadd" type="text" id="formadd"></td>
      </tr>
      <tr>
        <td>Phone:</td>
        <td><input name="formphone" type="text" id="formphone"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="Submit" value="Submit"></td>
      </tr>
      <tr>
        <td><input name="formname" type="hidden" id="formname">
          <input name="formemail" type="hidden" id="formemail"></td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </form></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>

------------------------------------------------------------------------------------------------------------------------------------
PAGE 3 (Final Review)

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<%
Dim formname, formemail, formadd, formphone
formname=request.form("formname")
formemail=request.form("formemail")
formadd=request.form("formadd")
formphone=request.form("formphone")
%>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="105">Name:</td>
    <td width="495"><%=formname%></td>
  </tr>
  <tr>
    <td>E-mail:</td>
    <td><%=formemail%></td>
  </tr>
  <tr>
    <td>Address:</td>
    <td><%=formadd%></td>
  </tr>
  <tr>
    <td>Phone:</td>
    <td><%=formphone%></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
------------------------------------------------------------------------------------------------------------------------------------

Thank you,
Shane
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 22

Assisted Solution

by:WMIF
WMIF earned 1000 total points
ID: 16712548
you have the hidden boxes in the code, but no values assigned.

        <td><input name="formname" type="hidden" id="formname">
          <input name="formemail" type="hidden" id="formemail"></td>



you need the value property set.

        <td><input name="formname" type="hidden" id="formname" value="<%=formname%>">
          <input name="formemail" type="hidden" id="formemail" value="<%=formemail%>"></td>
0
 
LVL 6

Expert Comment

by:BubbaisBest
ID: 16712560
lshane,

You need to give your hidden fields a value.  See my earlier post.

Bubs
0
 
LVL 6

Expert Comment

by:BubbaisBest
ID: 16712568
Sorry WMIF,

You are too quick on the fingers.

Bubs
0
 

Author Comment

by:lshane
ID: 16712978
I apologize, BubbaisBest, I misunderstood your advice.  Thank you, as well, WMIF, for the visual.  I applied the "values" and now it is working.

I didn't realize I had to do that.

Thanks so much!!
Shane

p.s. I'll split points.
0
 
LVL 6

Expert Comment

by:BubbaisBest
ID: 16713036
Glad you got it working and for the points.

Bubs
0
 

Author Comment

by:lshane
ID: 16713585
Sorry, BubbaisBest or WMIF.  I have one other question related to this.  It's actually related to my taking the logic from your suggestions and applying to the "Live" site.  It involves calculation of integers (i.e. cint) not transferring.  I'm getting a "data type mismatch" error regarding "cint".

I'll be more than happy to post another thread if I need to... I just thought one of you could clear it up rather quickly, since it is along the same vein.

I'll do whatever.

Thanks,
Shane
0
 
LVL 22

Expert Comment

by:WMIF
ID: 16713631
i dont mind.  share the code with us.
0
 

Author Comment

by:lshane
ID: 16713864
Great, thank you, WMIF.  I'll post the code, but first, if you don't mind, please view the form on the live site and you'll see that to which I'm referring.

http://www.charactercorner.com/newcc/registration.asp  (The only required fields at the moment are "Parent Name" and the first "Address" field.).

When you select "9th", "10th", "11th", or "12" grades from the "Student Information", it will prompt for the payment option.  All this transfers throughout the form just fine... however,

When selecting "7th" or "8th" grade from the "Student Information", it will prompt for the number of classes they will need.  The default value is "0" (You leave "0" or enter another number).  If you just click "Continue" 3 times, that will take you to the "Final Review" page, but it only gives the "data type mismatch" error regarding "cint".  "9th - 12th" populates fine, though... probably because they are just posting the "value" for the radiobutton name of "payoption", as opposed to the "7th" and "8th", which is a calculation.

I'll post the code on the next submission.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 16713898
i see the problem.  when you post the code, please indicate which line is 246.
0
 

Author Comment

by:lshane
ID: 16714077
You know what, WMIF, I figured it out.  Dumb mistake.  Was trying to calculate fields that did not need calculations, thus, they did not need "cint" conversions.

Thank you for your willingness to proceeed.

I think it's all good, now.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 16714104
glad you got it figured out.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question