Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I pass multiple vaules through 3 webpages

Status
Not open for further replies.

uncgis

MIS
Apr 9, 2004
58
US
I am trying to pass values between three webpages. The first page pulls data from the database and allows the user to select a row by clicking on the hyperlink. I used this code here.

response.write "<TD><a href=EditPatient.asp?Action=" & rsAddComments.Fields("PIDM") & ">" & "Edit" & "</a></TD>"

This redirects the user to the Edit Patient page and pulls the correct information. This code pulls the data

'File Name: EditPatient.asp
PIDM = Request("Action")
Session("PIDM") = PIDM


'SQL Statement
strSQL = "Select * FROM tblIden WHERE PIDM = " & PIDM & ""

'Populate recordset with data
rsAddComments.Open strSQL, adoCon

Here is the problem...I have error checking on the third page (EditPatientAdd.asp) that uses error checking to make sure certain fields are not blank.

ElseIf FirstName = "" OR len(FirstName) < 1 Then
response.redirect "EditPatient.asp?msg=" & Server.URLEncode("***The First Name must have at least 1 character.***")


The problem is the PIDM = Request("Action") no longer exists because it is replaced with the error message....
Does anyone know how to get around this or how to send two messages through the url..

Thanks
 
im not so sure if i understand your problem correctly but you may try this:

response.redirect "EditPatient.asp?Action=" & PIDM & "&msg=" & Server.URLEncode("***The First Name must have at least 1 character.***")

its basically putting two variables on the querystring.


biggie




The Man of Tomorrow is forged by his battles today.
 
That querystring worked for the most part... but the error message does not post on the webpage when it is redirected back...I am using the below code to display the msg...but the error message only posts in the url

Dim msg
msg = request.querystring ("msg")

any suggestions?

Thnaks
 
what i've done in the past is because the mess of things to handle on the form reciept is to break things up a little.

enter stage right, the fourth page.

the fourth page is dedicated to the handling of the data, the inserts, updates, deletes etc, then redirecting, or my personal preference, Server.Transfer back to the third page, (transfer keeps the form post headers intact, even though you might have "tickled" them in the data page)

by doing this you've successfully reduced the purpose of page 3 to be an entry form ( db populated of course ) but none the less, does no more than select the info from the db and show it.

nice part about this is the only thing page 3 needs is a record id. form validation, data type checking, etc can all be plugged into page 4.

now page 4 can have some "twists" one of which is being a "router" page that will accept all sorts of information process what's needed, then point and push along to the final destination ( basically made invisible )
or you can make it your "pass/fail" page where it displays the data that's missing/incorrect, or whatever other rules might be, with a button to correct entries (replicate form posted back to page3) (personally prefer this one)

if you need more information on form replication see the last couple replies to : thread333-824571

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Is there something on the redirected page that looks like:
If Request.QueryString("msg") <> "" Then
Response.Write("<p><font color="red">" & Request.QueryString("msg") & "</font></p>")
End if
[/code]
Or something? Just creating a variable won't do anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top