0

我正在使用MVC 5表單驗證來驗證表單上的電子郵件地址字段,但彈出的消息窗口未超過正確的字段,請參閱下面的內容:mvc 5表單驗證電子郵件地址消息窗口錯誤字段

Message Over Wrong Field

這是3個字段代碼:

<input class="underlineBox text-box single-line filledIn" data-val="true" data-val-required="The Name field is required." id="Name" name="Name" placeholder="ex. Jon Doe" type="text" value="" data-com.agilebits.onepassword.user-edited="yes"> 

<input class="underlineBox text-box single-line filledIn" data-val="true" data-val-email="The Email field is not a valid e-mail address." data-val-required="The Email field is required." id="Email" name="Email" placeholder="ex. [email protected]" type="email" value="" data-com.agilebits.onepassword.user-edited="yes"> 

<textarea class="underlineBox text-box multi-line filledIn" data-val="true" data-val-required="The Message field is required." id="Message" name="Message" placeholder="ex. Hi Syd, I would like to start a project together." rows="5"></textarea> 

任何想法?

回答

1

我使用MVC 5表單驗證驗證一個表單上的電子郵件地址字段,但彈出的信息窗口是不是在正確的領域

這不是jQuery驗證的圖片。默認情況下,jQuery Validate只是在字段旁邊插入文本。

您要顯示的是您的瀏覽器的HTML5驗證。這僅僅意味着您的JavaScript/jQuery驗證無論如何都不起作用。