i'm working on a contact form. i use this for form validation: http://plugins.jquery.com/project/form-validation-and-hints and i use a captcha that stores the code in $_SESSION['captchacode'] variable. what i'm trying to accomplish is to simply check using the jquery validator if user entered good captcha code. that's how check function works:
function isTypeValid( type, value ) {
var cap = <?php echo $SESSION["captchacode"];?>;
if( type == classprefix + 'Text' ) {
return true;
}
if( type == classprefix + 'Captcha' ) {
if(value==cap){
return (true);
}else{
return false;
}
}
}
i searched a few threads here and elsewhere and that's where i got
var cap = <?php echo $SESSION["captchacode"];?>;
from.
i've also tried this:
var cap = "<%= Session['captchacode'] %>";
and it didn't help... any ideas?