ASP.net MVC validation highlight and icon on incorrect fields Jquery

后端 未结 5 660
星月不相逢
星月不相逢 2021-01-03 06:30

I\'m looking for a way to change the default ASP.net MVC validation so that instead of putting a message next to each incorrect form field it would instead put an icon. I wo

5条回答
  •  有刺的猬
    2021-01-03 06:55

    Given the accepted answer, if you want to keep the original error message, just take out the transparent line and add a padding:

    .field-validation-error
    {
        background-image: url('http://findicons.com/files/icons/1014/ivista/128/error.png');
        background-repeat: no-repeat;
        background-size: 16px 16px;
        padding-left: 25px;
    }
    

提交回复
热议问题