p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: linking pages


Message #1 by "WVerner" <w_verner@h...> on Mon, 24 Mar 2003 13:55:03
headaches...sleepless nights and the battle continues!

i have got a page which allows a user to add atest to the system. It will 
add the test to a DB tabel test with fields : TestID, Title, 
SubmitterID,Creation Date and BookID (the book the test is about).

I have set up a page test which allows the user to input the title of the 
test and the BookID. Now the user must know the BookID which is not 
practical! So with help from you guys created a drop down box with all 
the titles of the book from a Book table....Now the problems arise when i 
try to incorporate these two pages together...

Test.asp is input page which leadds to addtest.asp which writes the test 
to the database.

bookdropdown.asp is my drop down list that i want to incorporate into 
test.asp and addtest.asp

There is alot of code for the three pages so i dont kno whether to paste 
in here?

Essentially i want a page that allows a drop down box with all the book 
titles in it which the user can select, then type a name for the test and 
on clicking submit will update the test table.

Message #2 by "WVerner" <w_verner@h...> on Mon, 24 Mar 2003 14:14:04
i got it working!!!!!!!!!!!!!!!!!!!!! :)
Message #3 by Mark Eckeard <meckeard2000@y...> on Mon, 24 Mar 2003 05:59:49 -0800 (PST)
Your 3 page scenario will work.  Try this:

bookdropdown.asp - Use a dropdown to display the list
of books.  The visitor will see the name
of the book, but the value of the select control will
hold the BookID.

When they submit Dropdown.asp, post to AddTest.asp

test.asp - On this page, request.form("dropdown") the
value that the visitor selected.
You can write it to a hidden text box like this:

<input type="hidden" name="HiddenBookId"
value="<%=request.form("BookID")%>">

On this page, the visitor will type in a test name in
a control called "TestName":

<input type="input" name="TestName" size="25">

Now post this page to AddTest.asp

addtest.asp - This last page will request.form the
above 2 controls and insert it into
your database.

Mark.

--- WVerner <w_verner@h...> wrote:
> headaches...sleepless nights and the battle
> continues!
> 
> i have got a page which allows a user to add atest
> to the system. It will 
> add the test to a DB tabel test with fields :
> TestID, Title, 
> SubmitterID,Creation Date and BookID (the book the
> test is about).
> 
> I have set up a page test which allows the user to
> input the title of the 
> test and the BookID. Now the user must know the
> BookID which is not 
> practical! So with help from you guys created a drop
> down box with all 
> the titles of the book from a Book table....Now the
> problems arise when i 
> try to incorporate these two pages together...
> 
> Test.asp is input page which leadds to addtest.asp
> which writes the test 
> to the database.
> 
> bookdropdown.asp is my drop down list that i want to
> incorporate into 
> test.asp and addtest.asp
> 
> There is alot of code for the three pages so i dont
> kno whether to paste 
> in here?
> 
> Essentially i want a page that allows a drop down
> box with all the book 
> titles in it which the user can select, then type a
> name for the test and 
> on clicking submit will update the test table.
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

  Return to Index