Ok, after sayng i'm good, i find i'm not!!
Heres the thing....
I have page 1 which has a form on it. when a button is clicked, it passes
the data from the form onto page 2. Thats easy (even for me!), but after
page 2 loads, I need it to popup a message box asking the user to make a
choice and redirect to another page based on the response. When the page
redirects I need it to redirect using values already bought into the page
but cannot pass the values into the script (if that makes sense) Heres how i
have the code on page 2....
<%@ LANGUAGE=VBScript %>
<%Response.Buffer = True%>
<%
Dim var1, var2 and other connection vars
Set objConnString = Server.CreateObject("ADODB.Connection")
Set rs1 = Server.CreateObject("ADODB.Recordset")
strDSN = "provider=sqloledb;Data Source=BARCA;Initial
Catalog=JellyTracker;User Id=sa;Password=LpmMww2502;"
objConnString.Open strDSN
jtuser = request("user") --> this value is passed via the url string
callres = request("callres") --> this value is collected from the previous
pages form
callnum = request("callnum")--> this value is passed via the url string
closedby = request("closedby") --> this value is collected from the previous
pages form
closetype = request("closetype") --> this value is collected from the
previous pages form
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style type="text/css">
</style></head>
<body>
<SCRIPT LANGUAGE="VBScript" >
answer=MsgBox ("Call Sheet", vbYesNoCancel, "Click Yes to create a call
sheet")
If answer = "6" then
document.redirect.href="page3.asp?callnum=<%=calln um%>&callres=<%=callres%>"
Else If answer = "7" Then
document.redirect.href="page1.asp?callnum=<%=calln um%>&callres=<%=callres%>"
End If
End If
</SCRIPT>
</body>
</html>
Within the <script> tags, i cannot get the variables <%=callnum%> or
<%=callres%> (or anything else) to show their values, and am completely
stumped, outside the tags, I can see and manipulate them any way I want.
Am I being a bit of a plank here? Is there an easy way for me to do this?
Any help would be appreciated.
Thanks in advance
Paul
"Paul" <> wrote in message
news:C3DAA96C-76C2-428D-BE47-...
> Hi all,
>
> sorry to waste your time, I have resolved it myself!!
>
> Changed this line:-
> document.redirect="test2.html"
> To this:-
> document.location.href="test2.html"
>
> thanks again!
>
> "Paul" <> wrote in message
> news
201461F-C97B-4573-B5C3-...
>> Hi all,
>>
>> This will hopefully be a really simple question....
>>
>> I'm a newbie at web app development, and am teaching my self as I go. I
>> have a page that requires a user to click a
>> button which then pops up a message box asking the user to make a choice.
>> Based on this choice, it will either redirect to another page or display
>> a message. I can get it to display a message, but when it tries to
>> redirect I get the error;
>>
>> "Error: Object doesn't support this property or method:
>> 'document.redirect'"
>>
>> I have tried researching this error but cannot find a solution that
>> works, can anyone help?
>>
>> The page code is as follows;
>>
>> <form>
>> <INPUT TYPE="BUTTON" NAME="button_2" VALUE="Click Here!">
>>
>> <SCRIPT LANGUAGE="VBScript" >
>> Sub button_2_onclick
>> answer=MsgBox ("Call Sheet", vbYesNoCancel, "Click Yes to create a call
>> sheet")
>> If answer = "6" then
>> document.write("answer = ")&answer
>> Else If answer = "7" Then
>> document.redirect="test2.html"
>> Else if answer = "2" then
>> exit sub
>> End If
>> End If
>> End If
>> End Sub
>> </SCRIPT>
>>
>> </form>
>>
>> Many thanks in advance
>>
>> Paul
>>
>