[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Classic ASP and parent forms

Posted on 2009-02-22
8
Medium Priority
?
266 Views
Last Modified: 2012-05-06
Hey there,
I've writing a small piece of code, where on one page I choose a date, click a button and on the pop-up, I show all courses available for that date. I'm having trouble with the page showing the courses. I can't seem to make the child form read anything from the parent form. I've found how to do it through HTML, but since it will be affecting the sql, I need to do it in the asp, before the second form is fully created. Is there a way with something like a request object, or do I have to use a session object?

Thanks
Eric
0
Comment
Question by:saragose
  • 6
8 Comments
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23708145
you need to have a Request.Querystring

Something like this:

(This in your Forms action)
childpage.asp?id=1  (of what every you need to show the records)

In the child page.
You will have your database SELECT statement like so:

getPage = Request.QueryString("id")
sql = "SELECT field1, field2, field3 FROM Table1 WHERE "& getPage & ""

(Body of page)
Read your records here.

That is it.
If you need an example code of this procedure, please provide your Table Structure
And I will be glad to make up one for you

Carrzkiss
0
 
LVL 19

Expert Comment

by:daveamour
ID: 23709004
carrzkiss is right but just a note that the sql statement isn't quite correct.  It should be more like:
sql = "SELECT field1, field2, field3 FROM Table1 WHERE column1 = " & getPage
Also this is susceptable to SQL injection attacks so you need to code defensiveley:
http://en.wikipedia.org/wiki/SQL_injection
 
0
 

Author Comment

by:saragose
ID: 23712686
That's really useful.

But my issue now, is to send data back to the parent page. I wanted to use the child page to populate fields on the parent field based on what they click. I assume that I can do this with Javascript?

Thanks
Eric
0
Independent Software Vendors: 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!

 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23715455
opps.
Forgot that part.
Sometimes writing fast can forget code .... Sorry about that.
Good eye Dave
0
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 200 total points
ID: 23715486
Explain please what you mean by sending data back to the parent?
Are you talking about>...

You edit the information in the Child Page.
And then once you submit, it displays the updated information to the parent?
Is this what you are wanting to do?

If so, then you will need something like this.
http://www.rgagnon.com/jsdetails/js-0066.html

Good Luck
Carrzkiss
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23720715
saragose:
Any progress in this issue?
Please keep us informed.

Carrzkiss
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23751684
hey Eric.
You going to come in a finalize this post, or leave it hanging in limbo?
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 23936534
Time to finalize this one.
It has been way to long since you opened it and we assisted you with it.
Please come in and award points so this can be closed out.

Thank you
Carrzkiss
0

Featured Post

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.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

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