S
sajoca3
Help! I posted 6 hr ago. I'm still struggling with this one!
this page has Numbric Captcha, random number a person has to type-in
too match then go to next page
trying to pass function CheckCAPTCHA(valCAPTCHA) to javascript
function SubmitForm()!
if true! go to nextpage.
my question is how can i pass variable that can red by
javascript???????
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1254"%>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<%
Function CheckCAPTCHA(valCAPTCHA)
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function
%>
<form id="frmLogin" name="frmLogin" method="post"action="default.asp">
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
if CheckCAPTCHA(strCAPTCHA) <> true then
%>
<tr>
<td height="37" colspan="2" align="center"><b
style="color:#FF0000">Please Retry.</b></td></tr>
<%
end if
end if
%>
<input type="button" name="cmdView" id="cmdView"
value="View"onclick="SubmitForm();">
</form>
..
..
<script type="text/javascript">
function SubmitForm() {
var captcha = document.getElementById("CheckCAPTCHA").value;
if (captcha == "True") {
document.frmLogin.action = "go_to_nextpage.asp";
document.frmLogin.submit();
}
else {
document.frmLogin.action = "stay_default.asp";
document.frmLogin.submit();
}
}
this page has Numbric Captcha, random number a person has to type-in
too match then go to next page
trying to pass function CheckCAPTCHA(valCAPTCHA) to javascript
function SubmitForm()!
if true! go to nextpage.
my question is how can i pass variable that can red by
javascript???????
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1254"%>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<%
Function CheckCAPTCHA(valCAPTCHA)
SessionCAPTCHA = Trim(Session("CAPTCHA"))
Session("CAPTCHA") = vbNullString
if Len(SessionCAPTCHA) < 1 then
CheckCAPTCHA = False
exit function
end if
if CStr(SessionCAPTCHA) = CStr(valCAPTCHA) then
CheckCAPTCHA = True
else
CheckCAPTCHA = False
end if
End Function
%>
<form id="frmLogin" name="frmLogin" method="post"action="default.asp">
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
strCAPTCHA = Trim(Request.Form("strCAPTCHA"))
if CheckCAPTCHA(strCAPTCHA) <> true then
%>
<tr>
<td height="37" colspan="2" align="center"><b
style="color:#FF0000">Please Retry.</b></td></tr>
<%
end if
end if
%>
<input type="button" name="cmdView" id="cmdView"
value="View"onclick="SubmitForm();">
</form>
..
..
<script type="text/javascript">
function SubmitForm() {
var captcha = document.getElementById("CheckCAPTCHA").value;
if (captcha == "True") {
document.frmLogin.action = "go_to_nextpage.asp";
document.frmLogin.submit();
}
else {
document.frmLogin.action = "stay_default.asp";
document.frmLogin.submit();
}
}