I want to create a Captcha to add new users on my website. To do this I'm trying to use the CaptchaMvc.Mvc5 but it doesn't show de refresh button to change the captcha image.
Looking at the developer inspect of Chrome it has an exception about Uncaught ReferenceError: $ is not defined at add:271 and I think this is the problem, then, in this line has this code below generated by CaptchaMvc.Mvc5.
line 271
<div class="text-center">
<script type="text/javascript">
$(function () {$('#0e12b41cddf84cd6a548118316ab8aed').show();}); //line 271
function ______3eec991ccebe425ba220485ba983374e________() { $('#0e12b41cddf84cd6a548118316ab8aed').hide(); $.post("/DefaultCaptcha/Refresh", { t: $('#CaptchaDeText').val() }, function(){$('#0e12b41cddf84cd6a548118316ab8aed').show();}); return false; }</script>
<br/>
<img id="CaptchaImage" src="/DefaultCaptcha/Generate?t=d230fe1e79a3448f987705cf22a90432"/><input id="CaptchaDeText" name="CaptchaDeText" type="hidden" value="d230fe1e79a3448f987705cf22a90432" /> <br/><a href="#CaptchaImage" id="0e12b41cddf84cd6a548118316ab8aed" onclick="______3eec991ccebe425ba220485ba983374e________()" style="display:none;">Refresh</a><br/>Digite o texto da imagem acima<br/><input autocomplete="off" autocorrect="off" data-val="true" data-val-required="Texto requerido" id="CaptchaInputText" name="CaptchaInputText" type="text" value="" /><br/><span class="field-validation-valid" data-valmsg-for="CaptchaInputText" data-valmsg-replace="true"></span>
<span class="field-validation-valid" data-valmsg-for="CaptchaInputText" data-valmsg-replace="true"></span>
</div><!--/captcha-->
How could I fix it ?
My Html
@{
var captcha = Html.Captcha("Refresh", "Digite o texto da imagem acima", 5, "Texto requerido", true);
}
<div class="text-center">
@captcha
@Html.ValidationMessage(captcha.BuildInfo.InputElementId)
</div><!--/captcha-->
