I am having issues with this code, whenever the javascript can't find the value for the document.theform.Step<%=Session("checkno")%>.value it will not submit the form. On forms that have the value, there are no issues. Why would this code fail, as it checks whether or not the value exists?
Code for checking values upon form submission:
var check940="<%=Session("check940")%>";
var checkno="<%=Session("checkno")%>";
if(document.theform.Step<%=Session("checkno")%>.value) {
var check940current = document.theform.Step<%=Session("checkno")%>.value;
if (check940=="yes" && check940current=="20")
{
alert("Test alert.");
}
}
Code for checking session variables and ensuring default value is assigned
<%
If len(Session("check940")) <= 0 Then
Session("check940") = "no"
end if
If len(Session("checkno")) <= 0 Then
Session("checkno") = "0"
end if
%>
When particular conditions are met, values are set to display alert in Javascript
if (steparr(0,s)<>"20") and (docnum="940") then
Session("check940") = "yes"
Session("checkno") = d
elseif (steparr(0,s)="20") and (docnum="940") then
Session("check940") = "no"
Session("checkno") = "0"
end if