Classic ASP and parent forms

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?

Who is Participating?
Wayne BarronConnect With a Mentor Author, Web DeveloperCommented:
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.

Good Luck
Wayne BarronAuthor, Web DeveloperCommented:
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 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:
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

saragoseAuthor Commented:
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?

Wayne BarronAuthor, Web DeveloperCommented:
Forgot that part.
Sometimes writing fast can forget code .... Sorry about that.
Good eye Dave
Wayne BarronAuthor, Web DeveloperCommented:
Any progress in this issue?
Please keep us informed.

Wayne BarronAuthor, Web DeveloperCommented:
hey Eric.
You going to come in a finalize this post, or leave it hanging in limbo?
Wayne BarronAuthor, Web DeveloperCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.