Hi, im a n00b at javascript. I am trying to create a simple test to make sure the user is human and not a bot.
so what i did was
<script language=javascript>
var check
var check2
check= (Math.random());
check2= (Math.round(check*100000));
document.write(check2);
</script>
I then created a verifyRequired script
<script language=javascript>
function verifyRequired(){
if (document.formcheck.security !=check){
alert("The security key entered is invalid")
return false;
}
return true;
}
My problem is that the verify function does not appear to beable to check the random number generated each time the page loads, any ideas on a possible work around.
so what i did was
<script language=javascript>
var check
var check2
check= (Math.random());
check2= (Math.round(check*100000));
document.write(check2);
</script>
I then created a verifyRequired script
<script language=javascript>
function verifyRequired(){
if (document.formcheck.security !=check){
alert("The security key entered is invalid")
return false;
}
return true;
}
My problem is that the verify function does not appear to beable to check the random number generated each time the page loads, any ideas on a possible work around.