Forgive me if I misunderstand...
Let's say the input field in question has an id attribute of
"checkCaptcha" i.e.
<input type="text" id="checkCaptcha"/>
Then you would retrieve the value of the input by calling:
var captcha = document.getElementById("checkCaptcha").value;
You would then update your CAPTCHA variable using whatever logic you
need:
if (captcha == "SomeValueThatMeansYes") {
CheckCAPTCHA = true;}
else {
CheckCAPTCHA = false;
}
or you could opt for the form:
var CheckCAPTCHA = (captcha == "SomeValueThatMeansYes") ;
Of course if this check is the only time in your method that you will
actually use the value, then you don't need to actually assign it to a
variable at all, you could use the actual == as your boolean.
So you would have something like:
function SubmitForm() {
var captcha = document.getElementById("checkCaptcha").value;
if (captcha = "SomeValueThatMeansYes") {
document.frmLogin.action = "default.asp";
document.frmLogin.submit();
}
else {
document.frmLogin.action = "pass.asp";
document.frmLogin.submit();
}
}
You would of course replace "checkCaptcha" with the id of your input
field and replace "SomeValueThatMeansYes" with the value you would
expect the input to have if you wanted to check captcha.
BTW...it's not recommended that you access the frmLogin element in the
global scope like you do. You should either assign an id to your form
element and access through document.getElementById("myFormId"), or
assign it a name and access through the
document.getElementsByName("myFormName")[0] array or use
document.forms["myFormName"]. You could also go crazy and access via
the document.getElementsByTagName("form")["myFormName"] array. You
should also update your script tag to use the type attribute, not the
LANGUAGE attribute (<script type="text/javascript">).
HTH.
depending on a input, I need to change var
checkcaptcha=(t/f)
if true then default else pass????
<SCRIPT LANGUAGE="JavaScript">
{
var CheckCAPTCHA=true
if (CheckCAPTCHA==true)
{
document.frmLogin.action = "default.asp";
document.frmLogin.submit();}
else
{
document.frmLogin.action = "pass.asp";
document.frmLogin.submit();
</SCRIPT>