Hello, I'm trying to get a Pop-up captcha to work when a timer hits zero then redirect to a page. Any ideas?
Basically I have a Javascript timer that opens a bPopup window (This Works): var x = 31 var y = 1 function startClock(){ if(x!=='Done'){ x = x-y document.frm.clock.value = x setTimeout("startClock()", 1000) } if(x==0){ $('#element_to_pop_up').bPopup(); x='Done'; }} Code (JavaScript): The problem is, the Solvemedia Captcha code is in PHP: <?php require_once("solvemedialib.php"); if(isset($_POST) && !empty($_POST)){ $privkey="your_private_key"; $hashkey="your_hash_key"; $solvemedia_response = solvemedia_check_answer($privkey, $_SERVER["REMOTE_ADDR"], $_POST["adcopy_challenge"], $_POST["adcopy_response"], $hashkey); if (!$solvemedia_response->is_valid) { print "<div class='alert alert-danger'> Error: ".$solvemedia_response->error."</div>"; } else { print "<div class='alert alert-success'> Successfully entered </div>"; } } ?> PHP: How do I start the Timer only if the Captcha is not solved yet?
You can use ajax to achieve what you want. There are plenty of tutorial about this on the web. but first things first you need to retrieve captcha value from the server then validate the input.