passing captcha variable to javascript????

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();
}

}
 
P

Peter Michaux

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???????

<URL: http://www.jibbering.com/faq/#FAQ4_18>

Nothing security-related to captcha should be done with client-side
scripting.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top