Hi
The first condition in red, in the function keeps printing out whether the condition is true or not – ie it prints out “you must select a date first” whether there is an active session called “left” or not.
How can I make it print this message [U]only
Thanks
<script language=”JavaScript”>
function emptyselectbox1()
{
var messagebox = “”;
[COLOR=”Red”]if (“<%=Session(“left”)%>”!==true)
{
messagebox+= “You must select a date first n”;
}
if (document.form3.checkIfClientEmpty.value.length<1)
{
messagebox+= “You must select a Client ID from the System first n”;
}
if (!(document.form3.select3.length>0))
{
messagebox += “There are no appointment times available n”;
}
if (document.form3.checkIfPatientEmpty.value.length<1)
{
messagebox+= “You must select a Patient ID from the System first n”;
}
if(messagebox.length>0)
{
alert(messagebox)
return false;
}
else
{
return true;
}
}
</script>
I also tried saving the session as a variable for javascript to use, like this
var messagebox = “”;
var thisID =”<%=Session(“left”)%>”
if (thisID!==true)
{
messagebox+= “You must select a date first n”;
}
but it still prints.