Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/05/2011, 08:38
eperezes
 
Fecha de Ingreso: mayo-2011
Mensajes: 3
Antigüedad: 12 años, 11 meses
Puntos: 0
conectar verificación de captcha en un cuestionario

Hola a todos,
tengo un cuestionario en el que quiero integrar la verificación del captcha y no se muy bien como hacerlo.
El cuestionario sería del estilo:
<form action="process.asp" id="form1" name="form1" onsubmit="return checkRequired(this)" method="post">

y luego tengo una función checkrequired para verificar que campos estén rellenos:
function checkRequired( theForm )
{
var bMissing = false;
if ( 0 == theForm.name.value.length )
bMissing = true;
if ( 0 == theForm.email.value.length )
bMissing = true;
if ( 0 == theForm.message.value.length )
bMissing = true;
if ( 0 == theForm.captchacode.value.length )
bMissing = true;
if ( bMissing )
{
alert( "All form fields are required.\n"
+ "Please complete them and Submit again.");

// false causes the form submission to be canceled
return false;
}
else
{
return true;
}
}

Quiero integrar mi verificación de captcha en esa función checkrequired, aunque no se cómo. El código es el siguiente e indica cuándo está verificado y cuándo no:
Response.Write("<tr><td colspan=""2"" align=""center"">")
if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode")) then
Response.Write("<b style=""color:#00CC33"">The code you enter verified.</b>")
else
Response.write("<b style=""color:#FF0000"">You entered the wrong code.</b>")
end if
Response.Write("</td></tr>" & vbCrLf)
end if

Gracias por alguna sugerencia de cómo hacerlo. saludos