【问题标题】:BootstrapValidator email validate issueBootstrapValidator 电子邮件验证问题
【发布时间】:2018-12-22 19:26:12
【问题描述】:

我在 ASP MVC 中使用 BootStrapValidator.js 进行表单验证,但我不验证电子邮件正则表达式导致 MVC 返回输入名称 =“电子邮件”,当我将输入框名称属性编辑为“电子邮件”时,验证器在名称 =“电子邮件”上工作“它工作正常。@Html.TextBoxFor(u => u.Email, new { placeholder = "sample@domain.com", @class = "form-control", id = "Email",type="email" }) 检查结果

<input class="form-control" id="Email" placeholder="sample@domain.com" value="" name="Email" type="email">

如果我将 name="email" 添加到 @html 帮助程序,它会更改为 "Email"

【问题讨论】:

    标签: ajax asp.net-mvc validation twitter-bootstrap-3


    【解决方案1】:

    我将@Html.TextBoxFor(u =&gt; u.Email, new { placeholder = "sample@domain.com", @class = "form-control", id = "Email",type="email" }) 更改为@Html.TextBoxFor(u =&gt; u.Email, new { placeholder = "sample@domain.com", @class = "form-control", id = "Email",type="email",@Name= "email" }) 它已修复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      • 2017-10-23
      • 1970-01-01
      • 2011-04-19
      • 2019-07-31
      • 2016-06-13
      相关资源
      最近更新 更多