Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Captcha MVC 4 refresh button is is not showing

I am using Captcha Mvc 4.0 (Vyacheslav)

Here is my code:

@Html.Captcha("Refresh", "Enter the text shown in imag"
                , 5, "Is required field.", false)

And here is the problem:

It is working smooth but refresh button is not showing, and it is due to style="display:none;"

<a href="#CaptchaImage" id="5f88fe4e11e743c6a8a8430de57cfcff"  
  onclick="______f9192ce4675540129ec6f99adc316d82________()"   
  style="display:none;">Refresh</a>

How to make it visible?

like image 359
Ali Adravi Avatar asked Apr 16 '14 15:04

Ali Adravi


1 Answers

In the code he does a .show() which only works if jquery is loaded. To fix this either import jquery before calling the method or do the following which will separate out the markup and the script.

@{
    var captcha = @Html.Captcha("Refresh", "Enter the text shown in imag"
                , 5, "Is required field.", false)
}

@captcha.RenderMarkup()

@section scripts
{
    @captcha.RenderScript()
}
like image 117
Derek Arends Avatar answered Sep 23 '22 14:09

Derek Arends