0
我在一个视图中有两种形式,其中一种形式中包含<recaptcha/>
标记,另一种形式没有。尝试提交没有验证码的表单会被其他表单中的验证码阻止,然后声明未验证的错误消息。在一种形式的Recaptcha阻止另一种形式
我使用的NuGet包:PaulMiami.AspNetCore.Mvc.Recaptcha,.NET 1.1核心
<form method="post" asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">
...
<div>
<div>
<button type="submit">Submit</button> <!-- Hitting this button, triggers the recaptchaErrorMessage to fire and block. -->
</div>
</div>
</form>
<form asp-controller="Contact" asp-action="SendMessage">
...
<div>
<recaptcha/>
<span id="recaptchaErrorMessage"></span>
<button type="submit">Submit</button>
</div>
</form>