|
-
Apr 11th, 2001, 12:33 PM
#1
Thread Starter
Lively Member
Code:
<!-- #include file="./Include/Constants.asp" -->
<HTML>
<HEAD><TITLE>Reporting Index</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function myFunc(number) {
...
window.alert (<% Session("GroupPass") %> );
...
}
// End -->
</SCRIPT>
</HEAD>
<%
If request.form("SaveInfo") = "Save Info" then
Session("GroupPass")= 10 Session("InfoSet")= 1
end if
%>
<BODY>
...
</BODY>
</HTML>
Problem:
The Session("GroupPass") variable is set to 10 yet when I use it in the alert I get a value of NaN.
How can I keep track of the GroupPass value in Javascript?
Thanks in advance,
rlb_wpg
-
Apr 11th, 2001, 01:14 PM
#2
Frenzied Member
Do this...
Code:
<%
If request.form("SaveInfo") = "Save Info" then
Session("GroupPass")= 10
Session("InfoSet")= 1
end if
%>
<!-- #include file="./Include/Constants.asp" -->
<HTML>
<HEAD>
<TITLE>Reporting Index</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
function myFunc(number) {
window.alert (<% Session("GroupPass") %> );
}
</SCRIPT>
This way you will actually set GroupPass before you use it.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Apr 11th, 2001, 01:25 PM
#3
you need quotes in that window.alert..
window.alert("<% blah %>")
-
Apr 11th, 2001, 02:04 PM
#4
Thread Starter
Lively Member
Ok, I've moved where I set the session variables to the top of file.
<%
If request.form("DoInfo") = "Save Info" then
'SET Session Info HERE
Session("GroupPass")= 10
Session("InfoSet")= 1
end if
%>
<!-- #include file="./Include/Constants.asp" -->
<html>
<HEAD>
<TITLE>Reporting Index</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
function myFunc(number) {
window.alert (<% Session("GroupPass") %> );
}
</SCRIPT>
...
I tried each of these:
1.
window.alert ("'" + <% Session("GroupPass") %> + "'" );
Produces 'NaN
2.
window.alert ("<% Session"GroupPass") %>" );
-> Produces a blank
3.
window.alert (<% Session"GroupPass") %>);
-> Produces a blank
Thanks for your input so far, do you have any other suggestions?
-
Apr 11th, 2001, 02:11 PM
#5
Frenzied Member
Code:
<%=Session("GroupPass")%>
With the equal.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Apr 11th, 2001, 03:12 PM
#6
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|