Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom Dia, Tenho uma página de registo dos utilizadores, onde é inserido, Utilizador, email, pass e captcha. Eu tenho um form para o efeito, usei o recaptcha da google, consigo saber se algum dos campos acima está preenchido, mas não consigo saber / implementar se o captcha foi ou não bem preenchido, e ter o resultado no momento do Submit, não sei que estou a fazer mal, ou o que não estou a fazer:( <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <meta http-equiv="Content-Type" content="text/html. charset=utf-8" /> <title>Documento sem título</title> <script type="text/javascript" src="../jquery/jquery-1.11.1.js"></script> <script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> <script type='text/javascript'> var RecaptchaOptions = { lang: 'pt', theme: 'clean', callback: Recaptcha.focus_response_field}. </script> <script type="text/javascript">
function validaform(valida) {
if(valida.aceita.checked == false) { alert("Tem que ler e concordar com os Termos de Uso da página!!"). valida.aceita.focus(). return false. }
if(valida.utilizador.value == "") { alert("O campo Nome de Utilizador é de preenchimento obrigatório!!"). valida.utilizador.focus(). return false. }
if(valida.emailid1.value == "") {
alert("O campo Email é de preenchimento obrigatório!!"). valida.emailid1.focus(). return false. }
if(valida.password.value == "") {
alert("O campo Password é de preenchimento obrigatório!!"). valida.password.focus(). return false. } return true. }. </script>
</head> <body> <form id="frm_novo_reg" name="frm_novo_reg" class="Login_1" method="post" action="includes_log/op_registo.php" enctype="multipart/form-data" onsubmit="return validaform(frm_novo_reg)">
<table width="700" height="150" border="0"> <tr> <td class="texto_form" width="185" height="40">Nome de Utilizador<a style="color:#F00. font-size:16px. font-weight:bold. "> *</a></td> <td> <input type="text" id="utilizador" name="utilizador" size="20" min="4" max="26" value=""/> <span class="rod_inf"> Entre 4 e 26 caracteres </span> </td> <td width="50" id="result_1" align="center" style="padding-bottom:20px. "></td> </tr> <tr> <td class="texto_form" height="30">Email<a style="color:#F00. font-size:16px. font-weight:bold. "> *</a></td> <td><input type="email" name="emailid1" size="30" value=""/></td> </tr> <tr> <td class="texto_form" height="30">Password<a style="color:#F00. font-size:16px. font-weight:bold. "> *</a></td> <td> <input type="password" name="password" maxlength="6" size="6" min="6" value=""/> <span class="rod_inf"> Entre 4 e 26 caracteres </span> </td> </tr> <tr> <td class="texto_form">Verificação de Segurança<a style="color:#F00. font-size:16px. font-weight:bold. "> *</a></td> <td> <?php require_once('recaptchalib.php'). $publickey = "6LfVJvwSAAAAAIrNgkJwXxJ_JQLdYNRYNOG8mHtm". // you got this from the signup page echo recaptcha_get_html($publickey).?> <div id="recaptcha_div"> <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LfVJvwSAAAAAIrNgkJwXxJ_JQLdYNRYNOG8mHtm"></script> <noscript> <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfVJvwSAAAAAIrNgkJwXxJ_JQLdYNRYNOG8mHtm" height="300" width="500" frameborder="0"></iframe><br> <textarea name="recaptcha_challenge_field" rows="3" cols="40"> </textarea> <input name="recaptcha_response_field" value="manual_challenge"> </noscript> </div> </td> </tr> <tr> <td></td> <td height="60"> <input type="checkbox" name="aceita" id="aceita" value="1"> Eu li e concordo com os <a class="texto_form" href="[http://www.xpto.pt](http://www.xpto.pt)" target="_blank"> Termos de Uso</a><br> </td> </tr>
</table> <table width="700"> <tr> <td width="185"> </td> <td width="255"> <p> <button type="submit" value="Registar" name="registar" class="Log-Registo" > Registar </button> </p> </td> </tr> <tr> <td> </td> </tr> </table> </form> </body>
</html>Carregando comentários...