I'm trying to implement a CAPTCHA for my registration page. I'm using the tutorial posted on this forum: (http://www.asprunner.com/forums/index.php?showtopic=4432&hl=CAPTCHA+how+to). I have all of the necessary elements in place (Before Registration code, uploaded freecap files etc) but keep getting an error message related to the registration HTML page.
Error Type: 256
Error Description:
Smarty error: [in register.htm line 30]: syntax error: unrecognized tag: if(document.getElementById) { thesrc = document.getElementById("freecap").src; thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4); document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()100000); (Smarty_Compiler.class5.php, line 436)
I have the Javascript function between the <FORM name=editform> and </form> tags. Below is a sample of the Javascript embedded in my register.htm page.
[codebox]<FORM name=editform action=register.php method=post encType=multipart/form-data
{$onsubmit}>
<TABLE height="99%" cellSpacing=0 cellPadding=0 width="70%" border=0>
<script type="text/javascript">
function new_freecap()
{
if(document.getElementById)
{
thesrc = document.getElementById("freecap").src;
thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()100000);
} else {
alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
}
}
</script>[/codebox]
Not sure where I'm going wrong. Thank you in advance!