View Full Version : Session Variable

10-20-2006, 11:59 PM
I am working on this page. I am pulling the session variable "test" from the previous page which is a number. If they enter that number on this page I want an alert to display saying that they cannot enter there on number. Can't seem to get it to work though.

<%@Language=VBScript %>

test = Session("test")

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<script language="javascript">
function chkForm() {
var test = document.frmOrder.test.value;
var SessionName = document.frmOrder.SessionName.value

// Check Number
if (test.value =SessionName) {
alert('You cannot enter this number');
return false



<form name="frmOrder" method="post" action="return.asp" onSubmit="return chkForm();">
<input type="hidden" name="SessionName" value="<%=test%>">

<table bgcolor="#ffffff" border="0" width="250" cellspacing="1" cellpadding="2" class="main">
<td bgcolor="#FFFFFF">Test:</td>
<td bgcolor="#FFFFFF"><input type="text" name="test" maxlength="5" size="5"></td>

<input type="Submit" value="Continue" name="Continue"><br>


Philip M
10-21-2006, 09:48 AM
if (test.value ==SessionName)

10-23-2006, 04:19 PM
Thanks, but it is still not working.

10-23-2006, 04:30 PM

if (test == SessionName)

10-23-2006, 04:35 PM
That did it! Thanks.